On this page
- Start a workflow
- Define the workflow’s inputs
- Add and connect nodes
- Set up an AI step
- Branch, loop or wait for approval
- Run steps once for each item in a list
- Run branches side by side
- Search and reshape data
- Pass data between nodes
- Retry a step or send its failure down another path
- Give an agent step files and get files back
- Run and test
- Resume a failed run
- Review past runs
- Schedule a job
- Share a workflow
- The canvas
- Variable groups
- Trigger nodes
- Agent node
- Other core and response nodes
- Tool nodes
- Logic nodes
- Data nodes
- Run statuses
- When something goes wrong
- How editions differ
Design a multi-step workflow agent
Lay out a workflow agent on the Generate canvas with agent, tool, logic and data nodes, set up each node, run and test it, and schedule its jobs.
This page shows you how to build a workflow agent on the Generate canvas, set up its nodes, run it, schedule it and share it.
The workflow builder is a canvas where you draw an agent as a series of steps. Each step is a node that does one thing, such as asking an AI model, searching your files or checking a condition, and the lines between nodes set the order. Use it when one set of instructions is not enough: a task that needs several AI steps, a decision between branches, a loop over a list, or a person’s approval before it continues. For an assistant that only needs instructions and tools, a chat agent is quicker to set up.
Start a workflow
Section titled “Start a workflow”Open a new, empty canvas with a name.
-
Select New agent
Select Agents in the sidebar, then New agent.
-
Choose Workflow builder
In Create your agent, select Create agent under Workflow builder. To start from a workflow template instead, select Browse on the Agents page and open one.
-
Name the workflow
In Edit Workflow Details, enter a Workflow Name and, if you like, a Description of up to 1,000 characters, then select Update. To change the name later, select it at the top left of the canvas.
Open full sizeShown in the enterprise edition. -
Find the Start node
The canvas opens with a Start node. The canvas section says what each control around it does.
Define the workflow’s inputs
Section titled “Define the workflow’s inputs”Name the values someone gives the workflow each time it runs.
-
Select the Start node
Its settings panel opens on the right with Input variables.
Open full sizeShown in the enterprise edition. -
Select Add Variable
Add one variable for each value the workflow needs.
-
Describe each variable
Set its Variable Name, Type, Description, Default Value and whether it is Required. Generate asks for these inputs before each run.
To let another system start the workflow instead, use an HTTP Trigger node in place of Start; see Trigger nodes.
Add and connect nodes
Section titled “Add and connect nodes”Lay out the steps and the order they run in.
-
Drag a node onto the canvas
Drag a node from the node list on the left onto the canvas. The list groups every node under Triggers, Core, Responses, Tools, Logic and Data. A second node of a kind already on the canvas takes the next number, such as Agent 2, so the run panel tells them apart; rename it in its settings.
Open full sizeShown in the enterprise edition. -
Connect it
Drag from the dot on one node’s right edge to the next node. A node with branches, such as Condition, has one dot per branch.
-
Label a connection
Select a connection to Edit Label or Delete it; Edit Connection offers No Label, True Branch, False Branch or a Custom Label with your own text.
-
Finish with an End node
A workflow needs an End node, or an HTTP Response node after an HTTP Trigger, before it can run. It starts from either a Start node or an HTTP Trigger node, never both.
-
Select Save
The button reads Saved! once it has.
Right-click a node for Duplicate or Delete. A duplicate keeps every setting of the original and takes the next number after its name. To have the canvas drawn for you, select the SuperAgent button in the canvas controls and describe the workflow; see SuperAgent.
Set up an AI step
Section titled “Set up an AI step”Have an Agent node call an AI model with your instructions and tools.
-
Select the Agent node
Its settings panel opens on the right. Changes there save to the workflow as you type.
Open full sizeShown in the enterprise edition. -
Write its instructions
Under Instructions, say what this step should do, with variables from earlier steps; see Pass data between nodes.
-
Check for questions
Under Before it runs, select Check for questions, then answer them and select Save answers, or Add to instructions.
-
Give it knowledge and tools
Add Knowledge, Connectors and Web Search, and set Done when, Effort and Output format. The Agent node table says what each one does.
Branch, loop or wait for approval
Section titled “Branch, loop or wait for approval”Send the run down different paths, repeat steps, or pause for a person.
-
Branch on a condition
Add a Condition node, select it, and write a JavaScript expression that returns true or false. Click to Insert Variable and Common Patterns help you write it.
Open full sizeShown in the enterprise edition. -
Or route to one of several outputs
Add a Switch node, select it, and choose Rules or Expression as its Mode. In Rules mode, select Add Rule for each output.
Open full sizeShown in the enterprise edition. -
Repeat steps in a loop
Add a While node, connect the steps to repeat to its Continue output and the step after the loop to Break, then write its Loop Condition.
Open full sizeShown in the enterprise edition. -
Wait for a person’s approval
Add a User approval node and write the Approval Message the approver sees. The run continues down its Approve or Reject branch.
Open full sizeShown in the enterprise edition.
The logic nodes table lists every setting of these four nodes.
Run steps once for each item in a list
Section titled “Run steps once for each item in a list”A Map step runs the steps inside it once per item of a list, a few items at a time, and collects every result.
-
Add a Map step
Drag Map from Logic onto the canvas, and connect the step that produces the list into it.
-
Point it at the list
In Items, reference a list, such as
{{fetch_rules.rows}}. Item name sets what the steps inside call the current item,{{item}}unless you change it, and they read its position as{{index}}. -
Connect the steps to repeat
Connect the first step to repeat to the Map step’s Body output, and link the last one back to the Map step. Connect the step that runs after every item to Done.
-
Choose how many run at once
Set Run at once from 1 to 16; it is 4 unless you change it. Each item runs with its own copy of the workflow’s data, so one item never sees another’s.
The Map step’s output is a list in the same order as its items. Each entry holds the item, its status (completed or failed), its output or error, and its start and end times. A failed item does not fail the Map step: the run goes on to Done with the other items’ results. During a run, the Workflow Execution panel lists each item under the Map step as it finishes, with its times and, for a failed item, its error.
Run branches side by side
Section titled “Run branches side by side”Connect one step to several steps to run them at the same time, then bring them back together.
-
Fan out
Connect one step to two or more steps. They start together, and the canvas marks the step they leave from Parallel.
-
Join the branches
Connect the last step of each branch to the same step. The canvas marks it Join; it runs once, after every branch has finished.
-
Read each branch in the join step
In the join step, reference each branch by its step, such as
{{fetch_orders}}and{{fetch_stock}}, notlastOutput, which is whichever branch finished last. If a field readslastOutput, the step’s settings show Don’t use lastOutput here with the references to use.
The Workflow Execution panel shows the run in numbered stages, and steps that ran at the same time share one, such as Stage 2 with 3 steps at the same time. A stage marks its Slowest step, because the next stage starts only once every step in it has finished. Agent steps share a limit on how many run at once across your workspace, 8 unless your administrator changed it; a step over the limit waits for a free slot and never fails for lack of one.
Search and reshape data
Section titled “Search and reshape data”Fetch data with a tool node and reshape it with a data node, without an AI model deciding how.
-
Search the web
Add a Web Search node, select it, and pick its Mode: Search, Extract or Crawl.
Open full sizeShown in the enterprise edition. -
Or use another tool node
Action, File Search and Database Search call a connector, your project’s files or one of its databases; see Tool nodes.
-
Reshape the result
Add a Transform node and write the TypeScript code that turns the previous output into the object the next step needs. Filter, Sort, Set State and HTTP do other fixed jobs; see Data nodes.
Open full sizeShown in the enterprise edition.
Pass data between nodes
Section titled “Pass data between nodes”Use an earlier step’s output, or a workflow input, in a later step’s settings.
-
Place the cursor in a text field
Most text fields in a settings panel take variables in double braces.
-
Select Insert Variable
Select Insert Variable (or Click to Insert Variable) and pick one from the variable groups.
-
Check the reference
For example, an agent’s instructions can say
Summarize this ticket: {{input.issue_description}}, and a condition can testlastOutput.status === "approved".
Retry a step or send its failure down another path
Section titled “Retry a step or send its failure down another path”Keep a long run going when one step fails for a reason that passes on its own, or record the failure and continue.
-
Open Retry on failure
Select the step and scroll its settings to Retry on failure.
-
Set the attempts
Set Attempts from 1 to 5, where 1 means no retry, and Wait before retrying (seconds), which doubles after each retry. Only a failure that can pass on a second try is retried: the model is unavailable or replies with nothing, a timeout, or a 429 or 5xx response. Any other error fails the step at once.
-
Connect the Error output
To continue when the step still fails, connect its Error output to the step that should handle it. The next step reads the failure as
{{lastOutput.error.message}}. A step with nothing on its Error output fails the run, as it always has.
Give an agent step files and get files back
Section titled “Give an agent step files and get files back”Hand an agent step earlier steps’ data as files, and keep the files it makes on the run.
-
Add an input file
Select the agent step and, under Input files, select + File.
-
Name the file and its data
Type a File name, such as
findings, and a Value that references an earlier step, such as{{fetch_orders}}. Before the step starts, a list of rows becomes a CSV file in the agent’s workspace, a file from this run is copied in, and anything else becomes JSON. A PDF or image the run received as base64 becomes the file itself when the File name ends in its extension, such asinvoice.pdf, or when the value is adata:URL. The agent is told each file’s name and row count, so the rows stay out of the conversation. -
Ask for a file in the instructions
Write in Instructions what file to make, such as a workbook with one sheet per region. A file the agent presents belongs to the run: the step shows it as a card with a download, and anyone who can view the run can download it.
Run and test
Section titled “Run and test”Run the workflow from the canvas and watch each step.
-
Select Run
Select Run in the toolbar. The Workflow Execution panel opens.
-
Fill in the inputs
If the Start node defines inputs, fill them in under Workflow Inputs.
Open full sizeShown in the enterprise edition. -
Select Run Workflow
The panel lists each step in its stage as it runs, with its status, and keeps the newest step in view until you scroll or click in the panel. Select a step to open its input, output and tokens in place; its node on the canvas comes into view and pulses. An agent step shows its own reasoning and tool calls, as a chat does, with each model call’s and tool call’s time on the right, so you can see what made the step slow. Select Stop in the toolbar to cancel a run.
Above the stages, a summary counts the steps done and lists any step that failed, with View details, or that waits on you, with Respond. On the canvas, each step shows its status and time under its node, the path the run took turns green, steps on a path it did not take fade, and a failed step pulses red. Select the mark under a node to open that step in the panel. Closing the panel clears the run from the canvas.
-
Answer when the run pauses
At a User approval node, approve or reject it in the panel. When approval steps on parallel branches wait at once, each one’s step in the panel shows its own Approve and Reject, and you answer them one at a time. When an agent step asks you a question, answer it and select Submit, or Skip to let the agent decide; if nobody answers in time, the agent continues with its best judgment. When a connector needs you to sign in, the run waits until you do.
-
Run it again or export it
To run again with the same inputs, select Re-run: the inputs are copied in for you to edit. Export run saves a run as JSON or JSONL.
Selecting Back while a run is still going asks first, because leaving cancels the run.
Resume a failed run
Section titled “Resume a failed run”Continue a failed run from the step that failed, keeping every step that finished before it.
-
Open the failed run
Open it in the Workflow Execution panel, or from Execution History.
-
Fix the failed step if it needs it
Change the failed step, or any step after it, and select Save. Leave the steps that already finished as they are.
-
Select Resume
Select Resume at the top of the panel. The run continues from the failed step, and the steps before it keep their results without running again.
The panel offers Resume for a run started with Run or by an HTTP call that waited for its answer, for 72 hours after it fails unless your site sets another window. If a step that finished in the run has been edited since, resume is refused with a message naming that step: undo the edit, or start a new run. Opening a step’s settings without changing them does not count as an edit.
Review past runs
Section titled “Review past runs”See every earlier run of the workflow and what each step did.
-
Open Workflow actions
Select the three dots in the toolbar.
Open full sizeShown in the enterprise edition. -
Select Execution History
It lists past runs with their trigger, time and status. Filter by Status or by Started from and Started to.
-
Open a run or export them
Open a run to see its steps, and select Export to download the runs that match.
The same menu holds Your jobs, which lists the workflow’s scheduled jobs, and Clear canvas, which removes every node.
Schedule a job
Section titled “Schedule a job”Run the workflow at set times, with nobody at the screen.
-
Select Schedule job
Open Workflow actions, select Your jobs, then Schedule job.
-
Name the job
Enter a Name and an optional Description.
Open full sizeShown in the enterprise edition. -
Set when it runs
Set Scheduled at, how it should Repeat and the Timezone.
-
Pick a project and inputs
Optionally pick a Project for the runs, and fill in the workflow’s Inputs.
-
Select Schedule job
Job options are the same as for an agent job.
Share a workflow
Section titled “Share a workflow”Give people access to run the workflow, or to change it.
-
Open the workflow’s options
On the Agents page, open the options on the workflow’s card.
-
Select Share
Share it as for an agent. You can also add it to a project so everyone in it can run it.
Someone with view access can open the workflow, run it and see its history, but cannot change a step; an agent step only lets them choose which of their own accounts it runs as.
The canvas
Section titled “The canvas”| Part | What it holds |
|---|---|
| The node list, on the left | Every node you can add, under Triggers, Core, Responses, Tools, Logic and Data. Hide it with Collapse sidebar. |
| The toolbar, at the top right | Workflow actions (the three dots), Undo, Redo, Run and Save. Undo and redo also work from the keyboard: Cmd+Z and Cmd+Shift+Z on a Mac, Ctrl+Z and Ctrl+Shift+Z elsewhere. |
| The canvas controls, at the bottom | Zoom in, Zoom out, Fit view, Background style (dots, lines or a cross grid), Lock canvas, animated connections and the SuperAgent button |
Variable groups
Section titled “Variable groups”| Group | What it holds |
|---|---|
| Input Variables | The inputs the Start or HTTP Trigger node defines, as input.<name> |
| Previous Nodes | The output of an earlier node, by its id |
| Special | lastOutput, the output of the node just before; inside a While loop also iteration, the loop count. A step two or more steps lead into does not offer lastOutput, because it is whichever branch finished last; pick each branch under Previous Nodes. |
Trigger nodes
Section titled “Trigger nodes”| Node | What it does and what you set |
|---|---|
| Start | Runs the workflow when you select Run or when a scheduled job fires. Under Input variables, Add Variable sets a Variable Name, Type (String, Number, Boolean, URL or Object), Description, Default Value and whether it is Required. |
| HTTP Trigger | Lets another system start the workflow with an HTTPS call. Its panel shows the Public URL (POST) and creates an API key the first time you open it; copy the token while it is shown, because it is not shown again, and manage keys later in Settings, then API Keys. Define Input variables as for Start; with none, callers send an empty JSON body. The panel also shows a cURL example of the call, and under Run without waiting the commands to start a run without waiting for it, check on it, follow it live and stop it. Pair it with an HTTP Response node to send something back. |
Agent node
Section titled “Agent node”The Agent node calls an AI model with your instructions and tools.
| Setting | What it does |
|---|---|
| Instructions | What this step should do, in plain English, with variables from earlier steps. A variable holding a PDF or image as base64 is put in the agent’s workspace, and the instructions show its file path; any other variable over 100,000 characters stops the step, so pass it under Input files |
| Before it runs | Select Check for questions to see what every run of this step would have to guess. Answer them and select Save answers, or Add to instructions to write the answers into the instructions. A question you skip is decided at run time. |
| Done when | A condition each run is checked against, such as “The table lists every region”. If it is not met, the step fails. |
| Effort | Low, Medium or High; higher thinks longer before answering |
| Web Search | Lets this step search, extract and crawl the web |
| Knowledge | Files, databases and network share files this step may search. Select + to add them; a file added here belongs to the workflow, and one picked from a project stays in its project. Removing a file from the node does not delete it. |
| Connectors | The connector tools this step may call. Select Add your first tool, pick a connector and then its tools. The connector must be connected for you on the Connectors page. |
| Output format | Text, or JSON shaped with the Output Schema Builder: Add Field for each field with a name and a type (string, number, boolean, array or object), or View Raw JSON to edit the schema directly |
| Input files | Earlier steps’ data written into the agent’s workspace before it starts, each with a File name and a Value: a list of rows becomes a CSV file, a file from this run is copied in, base64 named as a PDF, image or Office file is decoded to that file, anything else becomes JSON |
| Retry on failure | Attempts and Wait before retrying (seconds), as in Retry a step; a retry starts the step’s turn afresh |
Each agent step keeps its own knowledge; the workflow as a whole has none. Agent nodes do not take skills or a model choice.
Other core and response nodes
Section titled “Other core and response nodes”| Node | What it does and what you set |
|---|---|
| End | Marks where the workflow finishes |
| Note | A sticky note for comments on the canvas; it never runs |
| HTTP Response | Sets what an HTTP Trigger caller gets back when its branch finishes: a Response Type (JSON or Text), a Status Code and a Body. Leave the body as the previous node’s output, or write a Custom response. When two or more steps lead into it, the body it leaves alone returns each of their outputs. |
Tool nodes
Section titled “Tool nodes”These nodes do one fixed task without an AI model deciding how.
| Node | What you set |
|---|---|
| Action | Pick a connector, then one of its actions, then fill in the action’s parameters. The connector must be on and connected for you. |
| File Search | Pick a project and, optionally, files in it (none selected searches every file in the project), a Search Query and Max Results from 1 to 100 |
| Database Search | Pick a project and one of its databases, then write a SQL Query. Only SELECT and SHOW queries are allowed. |
| Web Search | A Mode of Search, Extract or Crawl, in the table below |
| Web Search mode | What you set |
|---|---|
| Search | A Search Query, Max Results from 1 to 10 and a Search Depth: Basic for quick results or Advanced for a fuller search |
| Extract | URLs, one per line; it returns their content |
| Crawl | One URL, a Max Depth from 1 to 5 for how far to follow links, and a Page Limit from 1 to 50 |
Logic nodes
Section titled “Logic nodes”| Node | What it does and what you set |
|---|---|
| Condition | Sends the run down one of two branches, If or Else. Write a JavaScript expression that returns true or false, such as input.score > 70. Common Patterns inserts ready-made checks: a number check, string equals, an array that is not empty, a nested JSON value, a range and an array that contains a value. |
| Switch, Rules mode | Routes the run to one of several outputs. Add Rule for each output sets its Output Name, Data Type (String, Number, Date & Time, Boolean, Array or Object), Comparison (such as is equal to, contains, is greater than or matches regex), the Field to test and the Value. Rules are checked from top to bottom and the first match wins. Under Options, Fallback Output decides where a run goes when nothing matches, and Ignore Case compares text without regard to letter case. |
| Switch, Expression mode | Set the Number of Outputs and an Output Index Expression, JavaScript that returns the output’s number, counting from 0. |
| While | Repeats the steps on its Continue output while the Loop Condition, such as iteration < 10, is true, then goes on through Break. Max Iterations is a safety limit, 100 by default; a loop also never runs more than 100 times, whatever the setting. |
| User approval | Pauses the run until a person approves or rejects it, then continues down the Approve or Reject branch. Write the Approval Message the approver sees, with variables such as {{lastOutput.summary}}. Only the person who started the run can approve or reject it. |
| Map | Runs the steps on its Body output once per item of the list in Items, then goes on through Done with a list of every item’s result. Item name is what the steps inside call the item, and Run at once how many items run together, from 1 to 16. The steps inside run unattended, so they can’t ask questions or wait for approval. Run mode is In parallel, where items run now a few at a time, or Provider batch, where each item goes to the model provider’s batch API as one model call and finishes within 24 hours. Provider batch needs one agent step with no tools inside, a direct OpenAI or Azure OpenAI model, and a scheduled or asynchronous run; the run shows Waiting for the model provider until the batch is done. |
Data nodes
Section titled “Data nodes”| Node | What it does and what you set |
|---|---|
| Transform | Runs TypeScript code you write in an isolated sandbox, and passes on the object it returns |
| Filter | Keeps the items of a list that meet your conditions. Set an Array Path if the list is nested, then Add Condition with a Data Type, Comparison, Field and Value; Combine with joins several conditions. Ignore Case and Less Strict Type Validation are under Options. |
| Sort | Orders a list. Simple sorts by Fields to Sort By, each Ascending or Descending; Random shuffles; Code takes a JavaScript compare function of a and b that returns -1, 0 or 1 |
| Set State | Sets workflow variables: a Variable Name, a Value Type (String, Number, Boolean, JSON or JavaScript Expression) and a Value. Later nodes read it as {{<variable name>}}. |
| HTTP | Calls any HTTP or REST API: the method (GET, POST, PUT, PATCH or DELETE), the URL, Authentication (None, Bearer Token, API Key or Basic Auth), Headers and a Request Body. Use Previous Output sends the last node’s output as the body, and Show API examples fills in a Slack message, a Notion page or a Zapier webhook. |
Run statuses
Section titled “Run statuses”Each step in the Workflow Execution panel shows Completed, Failed, Running, Waiting or Stopped. A step on a branch the run did not take shows Skipped.
The run as a whole shows one of these under the panel’s title:
| Run status | What it means |
|---|---|
| Queued | An HTTP call started it without waiting, and it has not started yet |
| Running | Steps are running |
| Waiting for approval | A User approval step waits for its answer |
| Waiting for a connection | A connector needs you to sign in |
| Waiting for you | An agent step asked a question |
| Waiting for the model provider | A Map step in Provider batch mode waits for its batch |
| Completed, Failed, Rejected, Stopped | It finished, failed, was rejected at an approval, or was stopped |
When something goes wrong
Section titled “When something goes wrong”| What you see | What to do |
|---|---|
| Workflow has no End node | Add an End node, or an HTTP Response node for an HTTP Trigger workflow, and connect the last step to it. |
| A node name followed by is not connected | Connect that node into the flow, or delete it. |
| A node name followed by needs an HTTP Trigger | An HTTP Response node only answers an HTTP Trigger call. Replace Start with an HTTP Trigger, or use an End node. |
| The run shows Waiting for a connection | Sign in to the connector the panel names, and the run continues. |
| This run can’t resume because a step was edited after it ran | A step that finished in the run has changed since. Undo that edit and select Resume again, or start a new run. |
| Don’t use lastOutput here in a step’s settings | The step joins branches. Replace lastOutput with the branch references the message lists. |
| A Map item shows Failed | Open the item to read its error. The other items still finished; fix the cause and run again, or add a Retry on failure to the steps inside. |
| A step fails with a 429, a timeout or an empty reply | Set Retry on failure on that step, so a second attempt runs before the step fails. |
| Duplicate credentials detected in the toolbar | Several steps use the same stored credential for one server. Check that this is what you meant. |
| A Done when step fails | The run did not meet the condition. Loosen the condition or improve the step’s instructions. |
| A loop stops with Stopped: reached the iteration limit | Raise Max Iterations (up to 100), or change the loop condition so it becomes false. |
| View only. You can’t change this step. | You have view access. Ask the owner for edit access; see Sharing. |
| The workflow shows as suspended | An administrator suspended it, so nobody can run it from the builder or its HTTP trigger until they lift it. You can still open and edit it. |
How editions differ
Section titled “How editions differ”| Edition | What changes |
|---|---|
| Enterprise, consumer, storage | Everything on this page. |
| Healthcare | An agent step’s Knowledge can also add healthcare datasets. |
| Airgapped | No connectors, so the Action node and an agent step’s Connectors have nothing to offer. |
Last updated on