Build

Workflows

The 19 tools for workflows. Before an agent first makes one, it reads guide topic workflows.

workflow_blocks

The blocks a workflow is built from (Start (start_trigger), Webhook Trigger (generic_webhook), RSS Feed (rss), App (app), Agent (agent), Condition (condition), Router (router_v2), Evaluator (evaluator), Workflow (workflow_input), Human (human_in_the_loop), Variables (variables), Wait (wait), Response (response), Note (note)): each with its fields (id, type, options, default, when it shows, advanced or not), its outputs and its best practices; and the kinds of item an Agent can create (its artifacts). Give type for one block. Read it before create_workflow or edit_workflow: inputs are set by these field ids.

Parameters

typestring
One block type.

app_events

A Tool kit app as an App block uses it: its picks (the app's own things a person picks on the block, such as a spreadsheet and its sheet or a channel: the connected Agents work only with them, event or no event, and the event uses them), and the events that can start a workflow: each one's slug, what it is, its settings for the block's eventConfig (the required ones marked; a setting a pick covers goes in picks) and the fields each event gives. Also whether the person has the app connected in Tool kit: an event of an app that is not connected is not switched on. For an integration (postgresql, s3, snowflake, http…): whether it is connected, its guide topic and its tools; it has no picks and no events.

Parameters

appstringrequired
The Tool kit app or integration, as an App block names it (e.g. gmail, google-sheets, slack, hubspot; postgresql, s3, snowflake, http).

create_workflow

Make a workflow in a space. It starts with a Start block (id "start"); operations are edit_workflow operations applied to it (add the blocks, connect "start" to the first one), and variables are its workflow variables. computer is the VM its runs get (size, internet, Data files); without it, the default: small (2 CPU, 4 GB), internet on, no files. Read guide topic "workflows" and workflow_blocks first. Then run it with run_workflow and read what each block gave before you hand it over.

Parameters

space_idstringrequired
titlestringrequired
Workflow name.
descriptionstring
One line: what it does and when.
operationsobject[]
Show child attributes
operation_typestringrequired
Type of operation to perform. One of add, edit, delete.
block_idstringrequired
Block id for the operation. For add, the id the new block gets: short, lowercase letters, digits and - (e.g. "fetch-deals"). Later operations and connections use it.
paramsobject
Parameters for the operation. For add: {"type": "agent", "name": "Write report", "inputs": {"task": "…", "artifacts": [{"action": "create", "kind": "report"}]}, "connections": {"source": "next-block-id"}}. For edit: {"inputs": {"temperature": 0.5}} NOT {"subBlocks": {"temperature": {"value": 0.5}}}; also "name", "enabled", "errorEnabled", "connections" (replaces all of this block's outgoing connections), "removeEdges": [{"targetBlockId": "x", "sourceHandle": "source"}]. For delete: omit params (its edges go with it). An App block's "app" is a Tool kit app (gmail, google-sheets, slack, hubspot…) or an integration (postgresql, mysql, mongodb, snowflake, s3, dynamodb, http, wikipedia…: integration_list lists them all). An app's event is one of app_events' slugs, its settings in "eventConfig"; its fields are filled in for you. An integration has no event: its App block only gives the Agents it is connected to its tools. inputs are the block's fields by id (workflow_blocks lists them); an Agent's own Inputs field is "inputs" among them ([{"name", "type", "value"}], the values its task works on). connections map a handle to a target block id, {"block": id}, or a list of those: "source" (or "success") when the block worked; "error" when it failed (needs "errorEnabled": true); a Condition's "if", "else-if-0", "else-if-1"…, "else"; a Router's "route-0", "route-1"… (in the order of its routes).
variablesobject[]
Workflow variables to add (operation "add").
Show child attributes
operationstringrequired
One of add, edit, delete.
namestringrequired
Variable name; read as <variable.name> (case, spaces and dots ignored).
typestring
For add/edit. Defaults to the existing type, or "plain" for a new one. One of plain, number, boolean, object, array.
valueany
For add/edit: the value every run starts with, converted to the type. Omit to leave it empty.
computerobject
The VM (computer) each run gets, shared by all the run's Agents: its size, its internet, and the Data files put in it. What you leave out stays as it is.
Show child attributes
sizestring
small: 2 CPU, 4 GB; medium: 4 CPU, 8 GB; large: 4 CPU, 16 GB. Default small. One of small, medium, large.
internetboolean
Whether it reaches the internet (pip and npm installs, web pages, APIs). Default true.
filesstring[]
Ids of the person's Data files (list_data; add_data adds one), put in files/ of every run's folder. The whole list: it replaces the one there is.

read_workflow

A workflow as it is now, people's edits included: every block with its inputs (field values), the tags its outputs are read by, and the handles a connection can leave it by; the edges; the workflow variables; its VM (computer: size, internet, Data files and where each is in the run's folder; vm: the VM service of this server, null when it makes none, and the VMs of its runs going on now); its triggers and how each starts it (the schedule, a webhook's URL and auth, an RSS feed's last check, whether an App event is switched on); its last runs; and checks worth fixing.

Parameters

item_idstringrequired

render_workflow

See a workflow as people do: a screenshot of its canvas (every block as a card, with its fields in words, and the connections between them), with one block's panel open when block is given (its fields as people set them), and errors the page hit. Check a workflow you built or changed with it before you hand it over.

Parameters

item_idstringrequired
blockstring
A block's id: shows its panel beside the canvas.

edit_workflow

Change a workflow with operations: add, edit and delete blocks, and their connections. Applied in this order whatever order you give them: deletes, adds, edits, then every connection (so a connection can name a block added in the same call). All or nothing: an unknown field, a reference to a block that does not run before, an output that block lacks, a handle the block does not have, a variable that does not exist or a loop is refused, saying what to fix. variables adds, edits or deletes workflow variables (applied first). computer sets the VM its runs get (size, internet, Data files). Also title, description, and pause_schedule (true pauses the Start block's schedule, false resumes it; the schedule itself is set on the Start block's inputs). read_workflow first: people may have changed it.

Parameters

item_idstringrequired
operationsobject[]
Show child attributes
operation_typestringrequired
Type of operation to perform. One of add, edit, delete.
block_idstringrequired
Block id for the operation. For add, the id the new block gets: short, lowercase letters, digits and - (e.g. "fetch-deals"). Later operations and connections use it.
paramsobject
Parameters for the operation. For add: {"type": "agent", "name": "Write report", "inputs": {"task": "…", "artifacts": [{"action": "create", "kind": "report"}]}, "connections": {"source": "next-block-id"}}. For edit: {"inputs": {"temperature": 0.5}} NOT {"subBlocks": {"temperature": {"value": 0.5}}}; also "name", "enabled", "errorEnabled", "connections" (replaces all of this block's outgoing connections), "removeEdges": [{"targetBlockId": "x", "sourceHandle": "source"}]. For delete: omit params (its edges go with it). An App block's "app" is a Tool kit app (gmail, google-sheets, slack, hubspot…) or an integration (postgresql, mysql, mongodb, snowflake, s3, dynamodb, http, wikipedia…: integration_list lists them all). An app's event is one of app_events' slugs, its settings in "eventConfig"; its fields are filled in for you. An integration has no event: its App block only gives the Agents it is connected to its tools. inputs are the block's fields by id (workflow_blocks lists them); an Agent's own Inputs field is "inputs" among them ([{"name", "type", "value"}], the values its task works on). connections map a handle to a target block id, {"block": id}, or a list of those: "source" (or "success") when the block worked; "error" when it failed (needs "errorEnabled": true); a Condition's "if", "else-if-0", "else-if-1"…, "else"; a Router's "route-0", "route-1"… (in the order of its routes).
variablesobject[]
Show child attributes
operationstringrequired
One of add, edit, delete.
namestringrequired
Variable name; read as <variable.name> (case, spaces and dots ignored).
typestring
For add/edit. Defaults to the existing type, or "plain" for a new one. One of plain, number, boolean, object, array.
valueany
For add/edit: the value every run starts with, converted to the type. Omit to leave it empty.
computerobject
The VM (computer) each run gets, shared by all the run's Agents: its size, its internet, and the Data files put in it. What you leave out stays as it is.
Show child attributes
sizestring
small: 2 CPU, 4 GB; medium: 4 CPU, 8 GB; large: 4 CPU, 16 GB. Default small. One of small, medium, large.
internetboolean
Whether it reaches the internet (pip and npm installs, web pages, APIs). Default true.
filesstring[]
Ids of the person's Data files (list_data; add_data adds one), put in files/ of every run's folder. The whole list: it replaces the one there is.
titlestring
descriptionstring
pause_scheduleboolean

get_block_outputs

The outputs of a workflow's blocks as the tags that read them (<blockname.field>), with their types: what you write in a later block's inputs. Without block_ids, every block's.

Parameters

item_idstringrequired
block_idsstring[]

get_block_upstream_references

What each given block can read: the outputs of the blocks that run before it (connected to it, directly or through others), as tags, and the workflow variables. A block can read only these.

Parameters

item_idstringrequired
block_idsstring[]required

run_workflow

Run a workflow now, as the Run button does, and wait for it (up to wait_seconds; a longer run keeps going: read it with read_workflow_run). It starts at the Start block when that leads somewhere; otherwise at the workflow's event trigger, run by hand; or at the trigger block named by trigger. Returns each block's status, output and time, the error of a block that failed, and the run's result (a Response block's data, or else the output of the last block to finish with nothing after it). An event trigger run by hand, with no workflow_input: at an App event no event comes: the App block passes nothing on, and the Agents connected to it do what their own task says with the app's tools (no Agent connected: refused); an RSS Feed takes the feed's newest item; a Webhook Trigger takes the body of its last call (never called: refused). With trigger and workflow_input, workflow_input is the event (a webhook body, a feed item, an email with the fields app_events lists). With block: run that one block alone, fed by what the blocks before it gave in their last run (Sim's run_block). A run is real: agents act in the person's apps and make and change items. A run that reaches a Human block waits for a person (status paused); resume_workflow_run answers it only when the person asked you to.

Parameters

item_idstringrequired
workflow_inputobject
What the run starts with: for the Start block its Inputs fields by name, and input (text); from an event trigger, the event (leave it out to have the trigger find a stand-in itself).
triggerstring
Start at this trigger block (its id): needed when the workflow has several event triggers and no Start block leading anywhere.
blockstring
Run only this block (its id).
wait_secondsinteger
How long to wait for it to finish. Default 120.

read_workflow_run

One run of a workflow: its status, its result, and for each block what it was given (its inputs with the references filled in), what it returned, how long it took and its error. Without run_id, the latest run. stop: true stops a run that is going.

Parameters

item_idstringrequired
run_idstring
stopboolean

list_workflow_runs

A workflow's runs, newest first (read_workflow shows only the last 5): each with its run_id, status, how it was started, when, how long it took, and its error. Read one in full with read_workflow_run, and an Agent block's work in it with read_agent_log.

Parameters

item_idstringrequired
limitinteger
How many, 20 by default.

read_agent_log

What an Agent block did in one run, step by step, as the Runs tab shows it: each try and model, its task, what the model said, every tool call with its arguments and what came back (the VM's read, write, edit and bash among them), the nudges, and the answer it submitted. read_workflow_run gives only what the block was given and what it returned; this is how it got there, for finding why a run went wrong or what it wrote in its VM. Without run_id, the latest run. A long log comes in parts: from is the character to start at, and next_from in the answer is where the next part starts.

Parameters

item_idstringrequired
blockstringrequired
The Agent block: its id, or its name.
run_idstring
frominteger

list_data

The person's Data: the files they keep in Artifacts (from any of their spaces) for workflows' VMs, newest first. Each with its id (what a workflow's computer.files takes), name, type, size, when it was added, and the workflows whose runs get it.

No parameters.

add_data

Add a file to the person's Data (up to 25 MB): from a public URL, as text (CSV, JSON, Markdown…), or as base64. Returns its id: give it in a workflow's computer.files (create_workflow, edit_workflow) and every run finds it in files/ of its folder.

Parameters

urlstring
textstring
base64string
namestring
The file name with its extension, e.g. "orders.csv". Needed with text or base64.
mimestring
Its type, e.g. "text/csv". Default: the URL's, text/plain for text.

list_skills

The space's own skills an Agent block can be given (its skills input: [{"skillId": id}]): each one's id, name and description. An Agent sees their names and descriptions and loads one in full when it needs it. With name: that skill's full instructions too.

Parameters

space_idstringrequired
namestring

save_skill

Make a skill in a space, or change one (give its id): reusable Markdown instructions an Agent loads when relevant, such as a scoring rubric, a support procedure or a writing style. name: kebab-case (lead-scoring-rubric); description: what it does and when to use it (up to 1,024 characters; the agent decides from it); content: the instructions (steps, expected output, edge cases; up to 50,000 characters). A whole SKILL.md (frontmatter name and description, then the body) can be given as content.

Parameters

space_idstringrequired
idstring
namestring
descriptionstring
contentstringrequired

delete_skill

Delete one of a space's own skills (built-in ones can't be deleted). Agents that list it stop saving until it is taken off them.

Parameters

space_idstringrequired
idstringrequired

agent_memory

The Agent blocks' memories in a space. Each Agent has its own (no two share one), named agent:<workflow item_id>:<block id>: the final results of its runs, of which it reads its last 5 at the start of each run. Without memory, the list; with it, that Agent's results; with clear: true, they are deleted (its next run starts with none).

Parameters

space_idstringrequired
memorystring
clearboolean

resume_workflow_run

Answer a run waiting at a Human block with the values of its Resume Form, by field name (typed: true, 3, not "true"). Resuming is not approving: the workflow's next blocks check what was submitted. Only when the person asked you to answer it for them.

Parameters

item_idstringrequired
run_idstringrequired
block_idstringrequired
valuesobjectrequired