The Workflow Engine (Steps)
Core Concepts: The Workflow Engine (Steps)
You now understand how SignStack uses Entities (data) and Templates (documents). The Workflow Engine is the heart of the platform that orchestrates these pieces, defining the process through a powerful, recursive structure built from Steps.
If a Blueprint is the overall plan, the Steps are the detailed instructions within that plan.
The Recursive Step Model: One Building Block 🧱
Unlike traditional flowchart tools, SignStack uses a single, unified building block called a Step. Every part of your workflow logic, from a major phase down to a single task, is represented by this same Step object. A Step can contain other Steps, allowing you to build hierarchies of any complexity.
There are two fundamental types of Steps, determined by the stepType property:
-
ContainerStep:-
Purpose: To group other
Stepsand define the logic for how they execute. It acts like a manager or a folder. -
Key Properties:
-
executionMode: Controls if children run one after another (SEQUENTIAL) or simultaneously (PARALLEL). -
completionRule(forPARALLEL): Determines when the container is finished (e.g.,ALLchildren must complete,ANYone child completes, or aQUORUMis met). -
steps: An array containing its childStepobjects.
-
-
-
TaskStep:-
Purpose: To define a single, specific action performed by a participant. It acts like an individual task or a file.
-
Key Properties:
-
stepType: Currently supported:PARTICIPANT_TASK. -
Task-specific configuration (e.g.,
roleKeyandlinksfor aPARTICIPANT_TASK).
-
-
Note: A
Taskstep cannot contain childsteps. It's a "leaf node" in the workflow tree.
-
SEQUENTIAL vs. PARALLEL Execution
The executionMode on a Container step is crucial:
-
SEQUENTIAL: Behaves like a standard checklist. Child steps run strictly one after the other. The container only completes after the last child finishes. -
PARALLEL: Behaves like a team assignment. All child steps start simultaneously. The container completes based on itscompletionRule(e.g., waiting forALLchildren, or completing as soon asANYchild finishes).
Why a Tree Structure? 🌳
This recursive tree structure provides several advantages over a free-form flowchart:
-
Structured & Predictable: It enforces a clean, hierarchical organization that prevents messy "spaghetti logic" and is easier to read and debug.
-
Encapsulation: A
Containerstep cleanly bundles a sub-process, making workflows modular and reusable. -
Clear Data Flow: The model for entity evolution is unambiguous, ensuring a clear and auditable path for data changes.
The Step model is a powerful but structured language for defining even the most complex business processes in a predictable and maintainable way.
➡️ Next: Core Concepts: File Management