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:

  1. Container Step:

    • Purpose: To group other Steps and 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 (for PARALLEL): Determines when the container is finished (e.g., ALL children must complete, ANY one child completes, or a QUORUM is met).

      • steps: An array containing its child Step objects.

  2. Task Step:

    • 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., roleKey and links for a PARTICIPANT_TASK).

    • Note: A Task step cannot contain child steps. 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 its completionRule (e.g., waiting for ALL children, or completing as soon as ANY child 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 Container step 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