BindAI Workflow
bindai-workflow provides workflow orchestration for the BindAI framework.
It provides the abstractions needed to define, execute, schedule, persist, serialize, deploy, and manage workflows composed of different types of execution nodes.
Features
- Workflow definitions
- Workflow builder and configuration
- Workflow execution instances
- Workflow registries
- Workflow storage
- In-memory workflow storage
- Agent nodes
- Runnable nodes
- Conditional nodes
- Parallel execution
- Join nodes
- Loop nodes
- Sub-workflows
- Start and end nodes
- Human tasks
- Retry policies
- Timeout policies
- Workflow scheduling
- Compensation actions
- Workflow history
- Workflow repositories
- Serialization and deserialization
- Workflow deployment
- Workflow factories
- Workflow management services
Public API
The package exposes the main workflow components directly:
from bindai_workflow import (
Workflow,
WorkflowBuilder,
WorkflowConfiguration,
WorkflowRegistry,
WorkflowInstance,
WorkflowStore,
MemoryWorkflowStore,
)
Additional workflow infrastructure includes:
from bindai_workflow import (
WorkflowFactory,
WorkflowManager,
WorkflowNodeFactory,
WorkflowSerializer,
WorkflowDeserializer,
WorkflowRepository,
WorkflowDeployment,
WorkflowServices,
)
Creating Workflows
WorkflowBuilder provides the builder API for constructing workflows.
from bindai_workflow import WorkflowBuilder
builder = WorkflowBuilder(...)
Workflow configuration is represented by WorkflowConfiguration.
from bindai_workflow import WorkflowConfiguration
The resulting Workflow represents the executable workflow definition.
Workflow Nodes
Workflows can be composed from different node types.
The package exposes:
Workflow
│
├── StartNode
├── AgentNode
├── RunnableNode
├── ConditionNode
├── ParallelNode
├── JoinNode
├── LoopNode
├── SubWorkflowNode
├── HumanTask
├── CompensationNode
└── EndNode
These nodes allow workflows to represent different execution patterns and control-flow structures.
Parallel Execution
ParallelNode provides parallel workflow execution, while JoinNode represents synchronization after parallel branches.
from bindai_workflow import (
ParallelNode,
JoinNode,
)
This makes it possible to model workflows where independent operations can execute concurrently before continuing to a later stage.
Conditions and Loops
Conditional and iterative execution are supported through:
from bindai_workflow import (
ConditionNode,
LoopNode,
)
WorkflowExpression is also available for workflow expressions:
from bindai_workflow import WorkflowExpression
Sub-Workflows
SubWorkflowNode allows a workflow to incorporate another workflow as part of its execution.
from bindai_workflow import SubWorkflowNode
This supports composing larger workflows from reusable workflow definitions.
Human Tasks
HumanTask provides a workflow task abstraction for human-involved execution.
from bindai_workflow import HumanTask
This allows workflow definitions to represent work that is not performed entirely automatically.
Retry and Timeout Policies
Workflow execution can use retry and timeout policies:
from bindai_workflow import (
RetryPolicy,
TimeoutPolicy,
)
These policies provide workflow-level execution controls without requiring every workflow node to implement its own retry or timeout behavior.
Workflow Scheduling
Workflows can be scheduled through WorkflowSchedule and WorkflowScheduler.
from bindai_workflow import (
WorkflowSchedule,
WorkflowScheduler,
)
The scheduler provides the workflow-level scheduling abstraction, while the schedule represents the scheduling configuration.
Workflow State and Instances
WorkflowInstance represents an execution instance of a workflow.
from bindai_workflow import WorkflowInstance
Workflow persistence is represented by WorkflowStore:
from bindai_workflow import WorkflowStore
BindAI also provides an in-memory implementation:
from bindai_workflow import MemoryWorkflowStore
This separation allows workflow execution state to be stored independently from the workflow definition.
Workflow History
Workflow execution history is represented by WorkflowHistory and can be persisted through a history store.
from bindai_workflow import (
WorkflowHistory,
MemoryHistoryStore,
)
MemoryHistoryStore provides an in-memory history implementation.
Serialization
Workflows can be serialized and deserialized through:
from bindai_workflow import (
WorkflowSerializer,
WorkflowDeserializer,
)
Factories are also available for constructing workflows:
from bindai_workflow import (
WorkflowFactory,
WorkflowNodeFactory,
)
Compensation
Compensation actions support workflows that need explicit recovery or compensating behavior.
from bindai_workflow import (
CompensationAction,
CompensationNode,
)
Workflow Management
Higher-level workflow management components include:
from bindai_workflow import (
WorkflowManager,
WorkflowServices,
)
These provide the management and service layer around workflow functionality.
Architecture
The workflow package separates workflow definitions from execution state and supporting infrastructure:
Workflow
│
├── Nodes
│ ├── Agent
│ ├── Runnable
│ ├── Condition
│ ├── Parallel
│ ├── Join
│ ├── Loop
│ ├── SubWorkflow
│ ├── Human Task
│ └── Compensation
│
├── WorkflowInstance
│
├── WorkflowStore
│
├── WorkflowHistory
│
└── WorkflowScheduler
Supporting components provide serialization, deployment, repositories, factories, and workflow management.
BindAI Integration
bindai-workflow integrates with other BindAI packages to orchestrate executable components.
For example, workflow nodes can coordinate agents and runnable components while workflow state, scheduling, retry, timeout, and history concerns remain within the workflow layer.
Development
This package is part of the BindAI workspace.
From the repository root:
uv sync
Run the complete test suite:
uv run pytest
Run static type checking for this package:
uv run mypy packages/bindai-workflow
Build the package:
uv build --package bindai-workflow
Documentation
For complete BindAI framework documentation:
License
BindAI is released under the MIT License.
Release files for bindai-workflow 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bindai_workflow-0.2.0.tar.gz | 17.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bindai_workflow-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.6 kB
Release files / bindai_workflow-0.2.0.tar.gz
| Download URL | bindai_workflow-0.2.0.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d659ee9919816395adcbae496911c317474f362518771a04097c88b070a50355
|
|
BLAKE2b-256 checksum How to use checksums |
3ade71cbb0641a856476dbc1108d591d827ed1eeb06290a990c828145024bdde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / bindai_workflow-0.2.0-py3-none-any.whl
| Download URL | bindai_workflow-0.2.0-py3-none-any.whl |
|---|---|
| Size | 30.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fee148436a822e7a1d698a3617e2a6f85804ca3e3f11bf1ee5e383315137136e
|
|
BLAKE2b-256 checksum How to use checksums |
f6f1c178b1769770e79758a4970764dd7db530e28169f3e26909e6240af44d24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|