Step Anatomy
Every step has the same top-level shape:| Field | Description |
|---|---|
slug | Unique identifier for the step inside the Activity Plan |
kind | The step type, such as SCRIPT or BRIDGE_CALL |
dependsOn | Steps or step actions that must complete before this step can run |
conditionExpr | Optional predicate that can skip the step |
config | Kind-specific settings |
Dependency Patterns
Run after another step completes:CREATE_TASK
UseCREATE_TASK when the workflow needs human judgment, correction, exception handling, or approval.
| Config key | Description |
|---|---|
taskTemplateRef | Task Template used to create the Task |
taskStatusSlug | Initial Task status |
waitForCompletion | Whether the Activity should pause until the Task reaches a terminal status |
taskData | Data copied onto the created Task |
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.
| Config key | Description |
|---|---|
moduleRef | Module to run |
options | Module-specific options |
perDocument | Whether to run once per document family |
maxParallel | Parallelism limit when running per document |
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
| Need | Prefer |
|---|---|
| One configured external API call with clear input and output | BRIDGE_CALL |
| Multiple calls, custom branching, or document mutation | SCRIPT using serviceBridge.call() |
| Pure routing or validation logic inside Kodexa | SCRIPT |
| External system update that should be visible as its own workflow step | BRIDGE_CALL |
