capturegraph.procedures.nodes.automatic.control
#
Control Flow Procedures#
Control flow procedures manage conditional logic, assertions, and program flow within workflows. These enable dynamic behavior, validation, and decision-making based on data conditions, user input, and runtime state.
Example
AssertBool
#
Asserts that a boolean condition is true, failing with a message if false.
Used to validate conditions and assumptions during procedure execution. If the condition evaluates to false, the procedure will fail with the provided error message.
Attributes:
| Name | Type | Description |
|---|---|---|
condition |
Procedure[PBool]
|
The boolean condition that must be true. |
message |
str
|
Error message to display if the condition is false. |
Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/control.py
IfThenElse
#
Bases: Procedure[T]
Conditional execution based on a boolean condition.
Executes one of two branches based on whether a condition is true or false.
Both branches must return the same type T. This enables dynamic workflows
that adapt based on user input, data conditions, or environmental factors.
Attributes:
| Name | Type | Description |
|---|---|---|
condition |
Procedure[PBool]
|
Boolean procedure to evaluate. |
true_branch |
Procedure[T]
|
Procedure to execute if condition is true. |
false_branch |
Procedure[T]
|
Procedure to execute if condition is false. |
Example
Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/control.py
DoNothing
#
A no-op procedure that does nothing and returns immediately.
Useful as a placeholder or default branch in conditional logic where one path should perform no action.
Example
Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/control.py
NullProcedure
#
Bases: Procedure[T]
A procedure that returns a null/empty value of type T.
Used as a placeholder that produces no actual data but maintains type compatibility. Useful for optional branches or default values.
Attributes:
| Name | Type | Description |
|---|---|---|
return_type |
type[T]
|
The type |