Before You Build
Define three things before opening Studio:Objective
Write one sentence describing the outcome this workflow should produce. If you can’t describe it in one sentence, consider splitting it into two workflows.
Input
List every field the workflow needs to run. Note the type (string, number, object) and whether each field is required or optional.
Build Flow in Studio
Add an Input block
Define the fields your workflow expects — text strings, numbers, or nested objects. This becomes the contract between your workflow and its callers.
Add processing blocks
Add Condition blocks to branch logic, Transform blocks to reshape data, and Agent blocks to generate or classify content. See Blocks for the full reference.
Wire outputs to inputs
Click a block’s output handle and drag to the next block’s input handle. Reference the connected value in your block config using
{{ block_id.output }}.Run in Console
Click the play icon to open the Console. Paste a real input payload and run the workflow. Inspect each block’s output before moving on.
The Practical Build Pattern
Use this five-step order for every production workflow. Keeping these phases separate makes each one easier to test, debug, and modify independently.1 — Validate Input
Check that required fields exist and have the correct type before doing anything else. A Condition block or a lightweight Transform block works well here.2 — Fetch Context
Pull any data the workflow needs from Databases, external APIs, or integrations. Keep fetches separate from decisions so failures are easy to isolate.3 — Transform and Decide
Shape the data and branch as needed. This is where Condition blocks route execution and Agent blocks make judgment calls.4 — Take Action
Write data, send messages, and call external systems — but only after validation has passed. Moving writes to this phase ensures a bad input never creates a partial record in your external tools.5 — Return Structured Output
Return a clean set of keys and values. Agents and downstream systems cannot reliably parse free-form text.Example: Processing a Support Ticket
Here is how the full pattern comes together for a workflow that receives a support ticket, classifies it, and routes it to the right team.Using Workflows as Agent Tools
When you expose a workflow as a tool for an AI agent, the input and output contract becomes even more important. Agents call tools programmatically — they cannot interpret ambiguous schemas or unstructured responses. Follow these rules for agent-facing workflows:- Keep the input schema small and explicit. Accept only the fields the workflow actually needs.
- Return predictable output keys. The agent reads specific keys — don’t change them between revisions without updating the agent’s instructions.
- Include clear failure messages in output. Return
{ status: "failed", reason: "ticket_id missing" }rather than throwing an unhandled error. - Avoid side effects before validation. The agent may call the workflow with incomplete data during exploration — validate first so nothing is written prematurely.
Common Mistakes to Avoid
Next Steps
Blocks
Choose the right block type for each step in your workflow.
Running Workflows
Execute your workflow from the Console, API, or SDK.
Environments
Promote your workflow from development to production safely.
Logs
Debug run failures and trace data flow between blocks.