Add single step
add_single_stepAdd ONE step to an orchestration using flat parameters — no JSON encoding needed for most fields. Only route_map_json, route_descriptions_json, parallel_branches_json, and human_fields_json are JSON strings. Preferred over add_steps for reliability.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"orch_id": "<orch_id>",
"step_id": "<step_id>",
"name": "<name>",
"type": "<type>"
},
"name": "add_single_step"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable step name | |
| type | Yes | Step type | |
| model | No | LLM model override for this step | |
| on_miss | No | When a page no longer matches a step: 'pause' (the default) gives the person the wheel; 'agent' has the step's agent_id, a Browser agent, find the way (browser steps). Either way the new path waits as a fix for a person to approve. | |
| orch_id | Yes | Orchestration ID from create_orchestration_skeleton | |
| step_id | Yes | Unique step ID (step_ + 7 alphanumeric chars) | |
| agent_id | No | Agent ID (required for agent/tool steps; on a browser step with on_miss 'agent', a Browser agent) | |
| loop_over | No | Expression over shared state yielding a list, e.g. `state.tickets` (loop steps). When set, the loop runs once per item instead of loop_count. Same restricted expression syntax as if_condition; filter a list in a transform step and loop over what it writes. | |
| max_turns | No | Max agent turns (default 15) | |
| input_keys | No | State keys this step reads | |
| loop_count | No | Number of loop iterations (fixed-count loops) | |
| output_key | No | State key this step writes to | |
| forced_tool | No | Tool name for tool steps | |
| pass_images | No | Agent steps only: Sees attachments. The images a person attaches in chat reach this step's model (pick one that can read images). A step that runs another workflow passes them on to it. Off by default; chat offers Attach only when a step has it. | |
| workflow_id | No | The id of the workflow a workflow step runs, as a nested run (workflow steps) | |
| human_prompt | No | Prompt shown to user (human steps) | |
| if_condition | No | Condition for if_else steps, evaluated against shared state. Use dot-notation: e.g. `state.result.flag == True` or `state.score > 5`. Missing keys are treated as None. Restricted Python over `state`. An expression reads `state` with dots, compares and combines values, and may call abs, all, any, bool, dict, enumerate, float, int, len, list, max, min, reversed, round, sorted, str, sum; and the methods on text: .capitalize, .casefold, .count, .endswith, .find, .index, .isalnum, .isalpha, .isdigit, .islower, .isnumeric, .isspace, .isupper, .join, .lower, .lstrip, .partition, .removeprefix, .removesuffix, .replace, .rfind, .rindex, .rpartition, .rsplit, .rstrip, .split, .splitlines, .startswith, .strip, .title, .upper; on a dict: .get, .items, .keys, .values; on a list: .count, .index; on a tuple: .count, .index. No f-strings, comprehensions or lambdas. | |
| ingest_kb_id | No | Knowledge base id the records are added to, from list_knowledge_bases (ingest steps) | |
| next_step_id | No | Next step ID. NOT used for evaluator/if_else/switch steps. REQUIRED on a parallel step, where it is the join and must name a merge step. | |
| recording_id | No | The recording a browser step replays by code, from list_recordings (browser steps; required). Recordings are made by a person in the app, never by the builder. | |
| loop_item_key | No | State key each for-each item is written to (default `loop_item`) | |
| loop_step_ids | No | Step IDs in loop body (loop steps) | |
| print_content | No | Markdown or plain text to store in output_key (print steps). Use {{ state.key }} or {{ state.key.nested }} to embed shared state values. | |
| loop_index_key | No | State key each iteration's 0-based index is written to, in every loop mode (default `loop_index`) | |
| max_iterations | No | How many times this step may run in one run (default 3). A route to it after that fails the run, unless on_exhausted_step_id names where to go. Raise it for a cycle a person drives (a revision or clarification loop). | |
| may_send_steps | No | Ids of the recording's steps that may send on their own (get_recording lists them). A run is never watched: any other send pauses it for the person. Default none (browser steps). | |
| merge_strategy | No | How to combine inputs (merge steps) | |
| retrieve_query | No | What to search for, with {{ state.key }} placeholders, e.g. `{{ state.question }}` (retrieve steps) | |
| retrieve_top_k | No | How many passages, 1-50; unset: the knowledge base's own (retrieve steps) | |
| route_map_json | No | JSON string mapping route labels to step IDs. Example: '{"approved":"step_abc","rejected":"step_def"}' | |
| transform_code | No | Python code: reads `state`, assigns `result` (transform steps) | |
| if_true_step_id | No | Step to go to when if_condition is True (if_else steps) | |
| ingest_id_field | No | Field naming each record, e.g. `ticket_id`: the same id replaces its record. Unset: an id from the record's content (ingest steps) | |
| prompt_template | No | Prompt with {{ state.key }} placeholders (for agent/llm steps) | |
| retrieve_kb_ids | No | Knowledge base ids to search, from list_knowledge_bases (retrieve steps; at most 10) | |
| retrieve_rerank | No | Rerank on or off; unset: the knowledge base's default (retrieve steps) | |
| timeout_seconds | No | Step timeout (default 300). An agent step whose agent runs a workflow waits on that workflow's own timeout_minutes at the default; set another value to cap it | |
| browser_sessions | No | Kept sessions the step's browser starts signed in with: ids from list_browser_sessions, or a site (e.g. 'portal.example.com') for the person's own session there. One per site; only the person's own or shared with them. Signing in is the person's, in Sessions. | |
| evaluator_prompt | No | Routing instructions for evaluator steps | |
| if_false_step_id | No | Step to go to when if_condition is False (if_else steps) | |
| human_fields_json | No | JSON string of field definitions. The answer is stored under output_key as a mapping {field name: value}: name the output_key for the step (e.g. `review`), not after a field, type it dict, and read one field as `{{ state.review.feedback }}`. Types: string, textarea, number, boolean, email, date, phone, choice (a dropdown; give it "options": [..], one is picked). Example: '[{"name":"feedback","type":"textarea","label":"Your feedback"},{"name":"decision","type":"choice","label":"Decision","options":["Approve","Later"]}]' | |
| ingest_text_field | No | Field holding the text to index; unset: the whole object is indexed as JSON (ingest steps) | |
| retrieve_snapshot | No | "active" (default), or a ksnap_… id to pin ONE knowledge base's index version (retrieve steps) | |
| switch_cases_json | No | JSON string mapping string values to step IDs (switch steps). Example: '{"approved":"step_abc","rejected":"step_def"}'. Unmatched values fall through to switch_default_step_id. | |
| switch_expression | No | Expression whose str() result is matched against switch_cases (switch steps). Example: `state.category` or `state.result.status.lower()`. Restricted Python over `state`. An expression reads `state` with dots, compares and combines values, and may call abs, all, any, bool, dict, enumerate, float, int, len, list, max, min, reversed, round, sorted, str, sum; and the methods on text: .capitalize, .casefold, .count, .endswith, .find, .index, .isalnum, .isalpha, .isdigit, .islower, .isnumeric, .isspace, .isupper, .join, .lower, .lstrip, .partition, .removeprefix, .removesuffix, .replace, .rfind, .rindex, .rpartition, .rsplit, .rstrip, .split, .splitlines, .startswith, .strip, .title, .upper; on a dict: .get, .items, .keys, .values; on a list: .count, .index; on a tuple: .count, .index. No f-strings, comprehensions or lambdas. | |
| output_fields_json | No | JSON string of the fields an llm or agent step answers (F1553): the step answers that one object, which the run holds its model to (asked once more, then the step fails), and a later step reads one as `state.<output_key>.<name>`. Types: text, number, boolean (a yes or no), choice (give it "options": [..]), list (of text). Example: '[{"name":"risky","type":"boolean","description":"Whether the change is risky"},{"name":"fit","type":"choice","options":["good","poor"]}]' | |
| ingest_records_from | No | State key holding the list of objects to add, e.g. `tickets` (ingest steps) | |
| loop_max_iterations | No | Hard ceiling on iterations for any loop mode (default 50) | |
| include_full_history | No | For agent/llm/tool steps: controls revision-history rendering on re-runs. Default (unset) auto-enables full history whenever this step runs more than once. Set false to force last-attempt only (smaller prompt); set true is equivalent to default. Only relevant if you want to explicitly opt OUT of full history. | |
| loop_break_condition | No | Condition evaluated after each iteration; True stops the loop (loop steps). Same restricted expression syntax as if_condition. | |
| loop_while_condition | No | Condition re-evaluated before each iteration, e.g. `(state.n or 0) < 5` (loop steps). Same restricted expression syntax as if_condition. | |
| on_exhausted_step_id | No | Step the run goes to when a route reaches this step after it has run max_iterations times, e.g. an escalation or a best-effort finish. Unset, the run fails with "'<step>' gave up after N attempts". | |
| recording_inputs_json | No | JSON object filling each of the recording's inputs (get_recording names them), each a value or a {{ state.key }} template. Example: '{"order number":"{{ state.user_input }}"}' (browser steps; every input filled). | |
| retrieve_filters_json | No | Optional JSON metadata filter (retrieve steps), e.g. '{"doc_type":"contract","year":{"$gte":2024}}'. Operators: $eq $ne $in $nin $gt $gte $lt $lte, combined with $and $or $not | |
| ingest_metadata_fields | No | Fields copied into each record's metadata, so retrieve steps can filter on them (ingest steps) | |
| parallel_branches_json | No | JSON string of branch arrays. Example: '[["step_a"],["step_b"]]' | |
| switch_default_step_id | No | Fallback step when no switch case matches | |
| route_descriptions_json | No | JSON string mapping route labels to descriptions. Example: '{"approved":"Ready to go","rejected":"Needs work"}' |