
Overview
Planning Mode allows you to:- Design multi-step processing workflows as a directed acyclic graph (DAG)
- Chain together module executions, human review tasks, JavaScript routing scripts, and AI agents
- Define dependencies between steps, including action-qualified edges (e.g., proceed only if “Approve” was clicked)
- Visualize the workflow as an interactive flow diagram
- Monitor execution progress with automatic deadlock detection
The Flow Editor
The visual flow editor provides a drag-and-drop interface for designing workflows:- Left panel — Node palette with available step types. Drag nodes onto the canvas to add them.
- Center — Interactive canvas showing nodes and edges. Draw connections between nodes to set dependencies.
- Right panel — Properties panel for the selected node. Configure step-specific settings here.
| Type | Color | Description |
|---|---|---|
| EXECUTION | Blue | Module execution |
| TASK | Green | Human review sub-task |
| SCRIPT | Violet | JavaScript routing/processing |
| AGENT | Amber | AI agent processing |
| AI_PLANNER | Purple | Dynamic AI planning |
Plan Node Types
Each step in a plan is a planned item with a specific type. The platform supports the following node types:EXECUTION
Runs a module (such as a parser, extractor, or classifier) on the task’s documents.| Field | Description |
|---|---|
moduleRef | Resource URI of the module to execute (e.g., module://kodexa/pdf-parser) |
options | Key-value options passed to the module at runtime |
TASK
Creates a sub-task assigned to a human reviewer. The plan pauses at this step until the reviewer completes the task by clicking an action button.| Field | Description |
|---|---|
taskTemplateRef | Slug of the sub-task template to use |
taskStatusSlug | Initial status to assign to the created sub-task |
taskData | Override title, description, priority, forms, actions, and document groups |
hideLock | Hide the lock button on the sub-task |
subTaskOnly: true so they do not appear in the main task creation dialog.
SCRIPT
Runs inline JavaScript to make routing decisions, inspect documents, modify content, or assign knowledge features. Scripts return an action name that determines which downstream dependency edge to follow, enabling conditional branching.| Field | Description |
|---|---|
script | JavaScript source code to execute |
scriptActions | Array of {uuid, name} objects defining the possible action outcomes |
Script Steps Guide
See the full Script Steps guide for the complete API reference, document modification examples, knowledge feature assignment, and ready-to-use code snippets.
AGENT
Spawns an AI agent to process the task’s documents autonomously. The agent uses configured modules as tools and follows a prompt to decide how to process the documents.| Field | Description |
|---|---|
agentRuntimeId | ID of the agent runtime to invoke |
agentModuleRefs | Module references available as tools for the agent |
prompt | Instruction prompt guiding the agent’s behavior |
AI_PLANNER
Uses an LLM to dynamically insert additional plan steps based on the current task context.| Field | Description |
|---|---|
plannerContext | Context information provided to the LLM for planning decisions |
maxStepsToInsert | Maximum number of steps the planner can add |
Dependencies
Each plan step can declare dependencies on other steps using thedependsOn array. Dependencies control execution order — a step will not start until all its dependencies have completed.
Simple Dependencies
In the flow editor, draw an edge from one node to another to create a dependency. In YAML:Action-Qualified Dependencies
When a dependency is on a TASK or SCRIPT step, you can qualify the dependency with a specific action. The downstream step only executes if the upstream step completed with that particular action. This enables conditional branching — for example, routing to different processing steps based on whether a reviewer clicked “Approve” or “Reject”:stepUUID:actionUUID. In the flow editor, when you connect from a TASK or SCRIPT node that has multiple actions, each action appears as a separate connection handle at the bottom of the node. Draw edges from the specific action handle to create action-qualified dependencies.
Example Workflows
Simple Extraction Pipeline
A linear workflow that parses a document, extracts data, then creates a review task:Conditional Branching with Scripts
A workflow that classifies documents and routes them to different processing paths:Approval Workflow
A workflow with a human approval gate that branches based on the reviewer’s decision:DAG Flow Visualization
Plans are displayed as an interactive top-to-bottom flow diagram in the plan monitoring panel. Each node represents a planned item, and edges show dependencies (with action labels on qualified edges). Node colors indicate status:- Pending — Waiting for dependencies
- Running — Currently executing
- Completed — Finished successfully
- Failed — Encountered an error
- Deadlocked — Blocked by a failed dependency (see below)
Deadlock Detection
The platform automatically detects deadlocked plans. A deadlock occurs when:- A plan step fails, and
- Other pending steps depend on the failed step (directly or transitively)
Getting Started
Create a Task Template
Navigate to Task Templates and create or edit a template. On the Details tab, check Enable Planned Sub-Tasks.
Open the Flow Editor
Switch to the Planned tab. The visual flow editor appears with a node palette on the left.
Add Plan Steps
Drag nodes from the palette onto the canvas. Configure each node using the properties panel on the right.
Connect Dependencies
Draw edges between nodes to set execution order. For TASK and SCRIPT nodes with multiple actions, connect from specific action handles for conditional branching.

