Workflows
A Workflow in Swytchcode is a combination of methods arranged in a specific order to achieve a defined task.
Workflows help you define reusable sequences of API or SDK calls that can be triggered easily in prompts or client requests.
- You can create common workflows for your project by combining existing methods.
- The number of workflows you can define depends on your current plan.
- Workflows can be triggered by name in prompts, making them a powerful tool for automation and code generation.
Naming Best Practices
It is important (and highly advisable) to give your workflow a name that:
- Clearly describes what the workflow does.
- Matches the phrases people are likely to use in prompts.
When a custom workflow is requested in a prompt, if the name is similar to an existing workflow, the system will:
- Match it based on similarity.
- Display the workflow’s methods.
- Provide the generated code for execution.
Example
Workflow Name: Process New Order
Methods in Order:
AuthenticateUser
CreateOrder
ProcessPayment
SendOrderConfirmation
When a user prompt says “process a new order”, the system will detect the similarity and automatically provide the steps and code from this workflow.
Key Benefits
- Reusable — No need to repeatedly define common method sequences.
- Prompt-Aware — Names can be matched directly from natural language queries.
- Efficient — Reduces time to set up frequently used operations.