ToolCallStepDefinition
Tool-call step β dispatches a single named V4 tool. Stuart 2026-05-19: the read-shape stored in ``workstreams.workstream.steps`` for V4 workstream templates uses ``type='tool_call'`` with ``tool_name``/``tool_params`` directly on the step. The write-side schema previously had no such variant, which caused every PATCH that included an existing tool_call step to 422 (`StepEditOverride` localStorage workaround in `apps/workstream-studio/src/lib/stepEditOverrides.ts`). This class closes that round-trip gap. Fields are intentionally permissive: ``tool_params`` is the same free-form ``dict`` the cycle launcher already passes through into ``task.step_definition``. The V4 executor reads ``tool_name`` + ``tool_params`` directly off the step blob.
| Field | Type | Description |
|---|---|---|
idrequired | string | β |
namerequired | string | β |
type | string | β |
description | string | null | β |
depends_on | string | object[] | β |
stage | string | null | β |
timeout | string | null | β |
retry_policy | RetryPolicy | null | β |
error_handler | StepErrorHandler | null | β |
emit_artifact | EmitArtifactSpec | null | β |
optional | boolean | β |
continue_on_error | boolean | β |
halt_conditions | HaltCondition[] | βitem shape |
parameters | StepParameter[] | βitem shape |
guards | StepGuard[] | βitem shape |
impact_level | "low" | "medium" | "high" | "critical" | Impact classification for steps.lowmediumhighcritical |
run_mode | "propose" | "auto_run" | Execution mode for steps.proposeauto_run |
requires_approval | boolean | β |
metadata | object | null | β |
examples | StepExample[] | null | Attached example files for this step. Each entry pairs a platform.file_uploads.file_id with a role + tags + notes so the runtime can shape its instruction. Bounded at 20 to keep a reasonable upper limit on the prompt preamble. |
applies_when | string | null | CEL predicate evaluated at MATERIALIZATION (not at step execution): the step is marked skipped when it evaluates False. Stored verbatim β the expression is parsed by celpy at launch, so any coercion here would change its meaning. |
tags | string[] | null | Categorical labels on the step itself (e.g. 'pdf-read', 'coutts', 'fy25'). Free-form; recommended tag set is documented per workstream surface. |
firm_question_codes | string[] | null | Blocker codes this step may raise that are questions the run asks the firm later, not reasons to stop. A code listed here is carried past the blocker barrier (and recorded on the run's carried_blockers) unless the resolution form refuses it. Matched exactly against the blocker codes this step itself raises; a code not listed here still stops the run. |
decides | any | treatment | classification | difference, when the step decides one |
domain_question | any | {domain, issue}: the domain question asked |
no_domain_reason | any | {reason, card_link}: no domain covers it |
tool_namerequired | string | V4 tool identifier (e.g. 'read_pdf_document', 'generate_pdf'). |
tool_version | integer | null | Immutable runtime-registry version to execute; omit for current. |
tool_params | object | Free-form parameter bag forwarded to the V4 tool. May contain Jinja2 placeholders like '{{ inputs.* }}'.show nestedEmpty object. |
expected_outputs | object[] | null | Optional output schema hints (name + type per entry). |
instruction | string | null | Optional natural-language instruction the runtime can use to shape the tool dispatch (e.g. prompt preamble for LLM-style tools). |
inputs | object | null | Input mappings β same Jinja2 surface as TaskStep. |