Build a workflow
Build a workflow in Studio's editor from steps, links and parameters, check it, and save it as your draft.
The workflow editor shows a workflow as steps on a canvas. You add steps, link them in the order they run, and mark the values that change from one run to the next as parameters. Then you check the workflow and save it as your draft.
Before you start
Open the Workflows tab and click New workflow, or Duplicate on a workflow you want to start from. See Workflows.
Add and link steps
- Click a step kind after "Add a step:" in the toolbar. The step appears on the canvas.
- Fill in the step's panel on the right, starting with its Title.
- Drag from a step's right edge to the next step to link them.
- To remove a step or a link, select it and press Delete.
| Step | What it does |
|---|---|
| Task | Work for the agent. Write the Instructions for the agent. Add an Agent role for a crew; in a chat with one agent, that agent takes each role |
| Ask the user | A step for you. Describe what you're asked to do, and add form fields (text, numbers, yes or no, pick one, pick several). With no fields, you do the work and press Done |
| Choice | You pick the next branch. Write the question and link the step to at least two next steps |
| Agent decides | The agent picks the next branch, by the question you write |
| Gate | Waits for the steps before it: each of them, or a number of them. It can stop waiting after some minutes, and an agent can check the results first |
| Loop | Repeats a step at most a number of times, within a token or time budget if you set one. You choose what happens when the budget is spent |
| Sub-workflow | Runs another published workflow as one step |
Under a task, Suggested tools tells the agent which tools to use for the step. Suggestions guide the agent; they don't give it any permission it doesn't have. Ends the run as failed on a step stops the run as failed when that step completes.
Use parameters
Parameters hold the values that change from run to run, such as a client name or a file.
- Click Parameters in the toolbar, then Add a parameter.
- Enter a key, such as
client, and choose its type, such as Text, Number, File or Date. - Choose where the value comes from: The user enters it, From an earlier step, Fixed value or The agent finds it.
- Write
{{client}}in a step's instructions where the value goes.
For From an earlier step, the earlier step declares what it produces under "What this step produces".
Check and save
- Click Name and description and give the workflow a name.
- Click Check. Fix what it lists, such as a
{{key}}that isn't a parameter, until it says "No problems found." - Click Save draft.
If Data Shield is on for your organization, Studio first shows the values it will mask. Click Save masked to save the workflow with those values masked.
After saving, Studio says "Saved as a draft. Submit it for publishing when it is ready." Your draft stays yours until you submit it: see Publish a workflow.
Get help from the assistant
Click Assistant in the toolbar. The assistant reads your draft and proposes changes. Click Accept or Reject on each one.
Best practices
- Start from a chat that worked. An organization admin can turn a chat into a first draft. See Turn a chat into a workflow.
- Keep one task per step. Short instructions are easier for the agent to follow and for you to check in the run.
- Run your draft before you submit it. Only you see its runs.
FAQ
Open Name and description and enter a name.
Check found problems. Fix each one, then click Save draft again.
Studio asks "Discard the changes?" when you close with unsaved changes. Click Keep editing to go back.