Deep dive into BizFirstAI node system - the building blocks of workflow automation with extensible hooks and lifecycle management.
A node is the fundamental execution unit in BizFirstAI workflows. It combines structural, configuration, runtime, and event-driven aspects.
id: UUID - Unique within process
processElementTypeCode: string - Type identifier (e.g., "ai-agent")
name: string - Display name
description: string - Documentation
inputPort: Port - Single input
outputPorts: Port[] - Multiple outputs (main, error, custom)
Connection Definition
{
"sourceElementId": "uuid-1",
"sourcePortKey": "main",
"targetElementId": "uuid-2"
}
Port Key Matching: ExecutionRouter matches on sourcePortKey to find next nodes.
Multiple Outputs: Node can have "main", "error", "success", custom ports
Atlas Forms Schema:
{
"controls": [
{
"id": "agentId",
"type": "select",
"label": "Agent",
"required": true
}
]
}
C# Executor Access:
// Typed property
private AiAgentConfig?
mySettings =>
(AiAgentConfig?)this.settings;
// Usage
var agentId = mySettings?.AgentId;
var temperature = mySettings?.Temperature;
ProcessElementExecutor - Base class for all node executors
Dependency Injection - Services available to executor
User Input During Execution - Chat, forms, approvals
External Integration - Trigger from external systems
Hooks provide a powerful extension mechanism for nodes. They allow you to intercept and react to node lifecycle events, trigger sub-processes, integrate with external systems, and implement domain-specific business logic.
OnBeforeExecute()
Called before executor runs
✓ Validate InputData
✓ Transform parameters
✓ Check conditions
✓ Trigger pre-flight checks
OnAfterExecute()
Called after executor completes
✓ Process results
✓ Notify systems
✓ Trigger workflows
✓ Record events
IExecutorHook
Full access to executor context
✓ Configuration details
✓ Execution state
✓ Input/output data
✓ Services & dependencies
Hook.OnHook()
Hooks can have their own hooks
✓ Composition pattern
✓ Chain of responsibility
✓ Multi-level events
✓ Event propagation
Record execution on blockchain
✓ Immutable audit trail
✓ Compliance proof
✓ Transaction signing
Notify teams of execution
✓ Slack notifications
✓ Teams messages
✓ Discord alerts
Archive & manage data
✓ Data retention policies
✓ GDPR compliance
✓ Storage optimization
Generate documentation
✓ Auto-generate articles
✓ Update knowledge base
✓ Create runbooks
Track business metrics
✓ Process mining
✓ Analytics events
✓ BI integration
Implement domain logic
✓ Plugin pattern
✓ DI integration
✓ Async support
Hooks can trigger independent sub-processes, enabling complex workflows like notifications, approvals, and data synchronization.
Trigger sub-process asynchronously without waiting
await _orchestrator
.TriggerSubProcessAsync(
notificationProcessId,
context,
fireAndForget: true
);
Trigger and wait for sub-process completion
var result = await _orchestrator
.TriggerSubProcessAsync(
approvalProcessId,
context
);
if(result.Success) { ... }
Execution Context
Node Context
Services
Audit & Tracking