Step Anatomy
Every step has the same top-level shape:slug, type, dependsOn, etc. There is no config: sub-block.
When an Activity starts, Kodexa copies the plan’s step graph into Activity-owned step rows. After that, the running Activity uses the materialized steps. Editing the Activity Plan affects future Activities, not Activities already in flight.
Dependency Patterns
Run after another step completes:route:review) is the upstream action’s slug — the stable identity declared on scriptActions[].slug, promptActions[].slug, bridgeActions[].slug, or a CREATE_TASK template’s action slug. Older plans use a uuid field on the action with the same semantic value; that is the legacy spelling of slug and still resolves, but new authoring should use slug.
Document Status
Each document family carries a status (a slug such aspending-review or completed). The setDocumentStatus field sets that status when a step completes, and a per-document conditionExpr over the document.* context lets steps react to it — both declaratively, without writing a SCRIPT step.
Setting status: setDocumentStatus
Add setDocumentStatus to any step to stamp the document family’s status when that step completes. On a per-document step it applies to the families that completed at that step; on a non-per-document step it applies to every document family in the Activity.
documents.setStatus(familyId, statusSlug) inside a SCRIPT — prefer the field for fixed, step-completion status changes, and the script call only when the status is conditional or computed.
Skipping on status
To skip a step based on the document’s current status, gate it with aconditionExpr over the per-document document.* context. The step is not taken for matching documents, and the steps that depend on it are skipped too.
documents.get(families[0].id).status and returns one of two actions (e.g. process / skip_to_review). The processing pipeline depends on router:process, so already-processed documents are skipped; a separate root depends on router:skip_to_review to route them straight to the review task. (A direct conditionExpr on the root plus an inverse-gated second root works too.)
setDocumentStatus and the document.* condition context operate per document, and are only populated in per-document Activity Plans — so a status-based conditionExpr has no effect in a plan that is not per-document.CREATE_TASK
UseCREATE_TASK when the workflow needs human judgment, correction, exception handling, or approval.
If
waitForCompletion is true, the Activity waits for the reviewer to complete the Task. The Task’s status or action can then drive the next step.
See Create Task Steps for the full human-work guide.
SCRIPT
UseSCRIPT when the workflow needs custom JavaScript logic.
Good uses:
- Route based on document content or metadata
- Normalize values before review
- Assign knowledge features
- Call several Service Bridges and make a decision
- Prepare inputs for another step
BRIDGE_CALL
UseBRIDGE_CALL when the workflow should call an external system as a first-class step.
Good uses:
- Validate extracted data against a system of record
- Post approved data to an ERP, CRM, claims, or lending system
- Fetch enrichment data needed by the next step
- Notify a downstream system when a workflow completes
EXECUTION
UseEXECUTION to run a module or automated processing component.
See Execution Steps for the full module execution guide.
LLM
UseLLM for bounded prompt execution where the Activity Plan owns the prompt, inputs, and result mapping.
LLM step for direct prompt execution. Prefer an AGENT step when the work requires tool use or multi-step reasoning.
See LLM Steps for the full prompt-step guide.
AGENT
UseAGENT when a bounded part of the Activity should be delegated to an agent runtime.
Typical uses:
- Draft a routine Activity Plan or Data Form
- Investigate a document exception and propose next steps
- Assemble test cases or validation checks
- Use tools to inspect project resources before producing a result
APPROVAL
UseAPPROVAL when a workflow must explicitly pause for authorization before continuing.
Choosing Between SCRIPT and BRIDGE_CALL
Make the graph explain the business process. Use first-class steps for work operators should monitor directly. Use scripts for logic that is naturally internal to a decision.
