Creates multi-step workflows with bot coordination.
Syntax:
ORCHESTRATE WORKFLOW "workflow-name"
STEP 1: BOT "bot-name" "action"
STEP 2: HUMAN APPROVAL FROM "email@domain.com" TIMEOUT 1800
STEP 3: PARALLEL
BRANCH A: BOT "bot-a" "process"
BRANCH B: BOT "bot-b" "process"
END PARALLEL
END WORKFLOWFeatures:
- Workflow state persists through server restarts
- Variables automatically passed between steps
- Human approval integration with timeouts
- Parallel processing support
ON EVENT
ON EVENT "event-name" DO
TALK "Event received"
END ONPUBLISH EVENT
PUBLISH EVENT "event-name"WAIT FOR EVENT
WAIT FOR EVENT "approval-received" TIMEOUT 3600BOT SHARE MEMORY
BOT SHARE MEMORY "key" WITH "target-bot"BOT SYNC MEMORY
BOT SYNC MEMORY FROM "source-bot"Optimized LLM Calls
result = LLM "Analyze data" WITH OPTIMIZE FOR "speed"
result = LLM "Complex task" WITH MAX_COST 0.05 MAX_LATENCY 2000The designer automatically detects:
- Tools: Simple input/output functions
- Workflows: Multi-step orchestration
- Regular Bots: Conversational interfaces
All existing BASIC keywords continue to work unchanged. New keywords extend functionality without breaking existing .gbai packages.