Skip to content

Commit c40a5f0

Browse files
committed
Minor updates to the Workflows documentation.
1 parent 9852603 commit c40a5f0

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

docs/dev/workflows.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,38 @@ There are two distinct types of Workflows:
4848

4949
### **Activity**
5050

51-
An **Activity** is an individual analysis or action within a Workflow, serving as the fundamental building block of the analysis process. Each Activity is responsible for a specific task and can be configured to define its execution behavior, dependencies, and eligibility criteria. Activities work together within the Workflow to carry out complex analysis tasks, with roles and configurations determining how they interact and execute. The Activity operates on an `AnalysisContext`, providing access to the binary data, analysis state, and transformation utilities.
51+
An **Activity** represents a fundamental unit of work within a Workflow. Activities are configurable components that form the building blocks of complex analysis pipelines. Activities can:
52+
- Execute specific tasks through callbacks
53+
- Make dynamic decisions
54+
- Manage dependencies and eligibility
55+
- Control concurrency and synchronization
56+
57+
Each Activity operates on an `AnalysisContext`, providing access to binary data, analysis state, and APIs for generating and modifying the intermediate language (IL) stack.
58+
59+
#### Activity Roles
60+
61+
Activities can have different **roles** that define their behavior and how they interact within the Workflow. The following table summarizes the different roles available for Activities:
62+
63+
| Role | Purpose |
64+
|------|---------|
65+
| `action` | Executes a specific callback or operation immediately within the current execution context |
66+
| `selector` | Dynamically chooses which child activities to execute based on configurable eligibility criteria |
67+
| `subflow` | Creates a new Task object and asynchronously processes a subgraph, synchronizing concurrent actions after completion |
68+
| `task` | Enqueues a subgraph into an existing Task object for concurrent execution |
69+
70+
#### Eligibility Control
71+
72+
Activities provide fine-grained execution control through:
73+
* Static configuration via JSON settings
74+
* Dynamic eligibility functions
75+
* Continuation and run-once behaviors
76+
77+
#### Continuation Support
78+
79+
Activities can be configured with `continuation` eligibility, allowing them to:
80+
- Remain on the execution stack after processing
81+
- Execute repeatedly until becoming ineligible
82+
- Build iterative processing patterns
5283

5384
### Workflow Machine
5485

@@ -331,11 +362,11 @@ Activities can have different roles, defining their behavior and how they intera
331362

332363
- `action`: The default role; performs a specific task.
333364
- `selector`: Contains child activities and uses an eligibility handler to determine which child activities to execute. This enables the ability to have a dynamic and reactive execution pipeline.
334-
- `subflow`: Creates a new task context and asynchronously processes its workflow sub-graph on a new thread within the workflow machine. The subflow executes asynchronously from the requestor, allowing the original thread to return immediately. Within this context, multiple task actions can be enqueued, enabling extensive parallel processing. After completing its workflow sub-graph, it enters a Stall state, waiting for all its asynchronous task actions to complete. If the `continuation` property is set to true, the subflow re-evaluates its dependencies upon finishing all task actions and re-executes. This facilitates complex iterative processes that continue until convergence is achieved.
365+
- `subflow`: Creates a new task context and asynchronously processes its workflow sub-graph on a new thread within the workflow machine. The subflow executes asynchronously from the requestor, allowing the original thread to return immediately. Within this context, multiple task actions can be enqueued, enabling extensive parallel processing. After completing its workflow sub-graph, it enters a Stall state, waiting for all its asynchronous task actions to complete.
335366
- `task`: Asynchronously processes the workflow graph on a new thread within the workflow machine. `task` activities enable the pipeline to execute asynchronously from its requestor. `task` activities require a task context to be present; if no task context exists, they execute immediately in the current thread.
336367

337368
!!! note
338-
Nested task contexts are not currently supported. We may consider adding this feature in the future if the need arises. Stated more simply, you may not embed a `subflow` within another `subflow`.
369+
Activities with the `subflow` role are only permitted in Module workflows. Subflows are not supported within Function workflows.
339370

340371
#### Activity Eligibility
341372

@@ -521,9 +552,6 @@ The **Workflow Machine** is the core engine that manages and executes workflows.
521552

522553
There is an API to interact directly with the Workflow Machine, allowing you to issue commands, query state, and control activity eligibility.
523554

524-
!!! note
525-
This API is only available in **Commercial** and above product editions. However, the Workflow Machine API is not required for the general use case of authoring or using workflows.
526-
527555
### WorkflowMachine CLI Commands
528556

529557
You can interact with the `WorkflowMachine` using the CLI for debugging purposes:

0 commit comments

Comments
 (0)