Overview
Theapplad workflows command manages automation workflows — multi-step sequences of messages, function invocations, delays, and conditions triggered by events or schedules. Each workflow is defined by a single yaml file in workflows/.
Commands
applad workflows list
Lists all workflows defined in the active project’sworkflows/ directory, along with their trigger type and whether they are currently active.
- Workflow name
- Trigger type (event, schedule, manual)
- Active/paused status
- Last execution time
applad workflows trigger
Manually triggers a workflow immediately, outside of its normal trigger condition. Useful for testing a workflow end-to-end without waiting for the triggering event.applad workflows logs
Shows the execution history for a workflow — every run, its steps, which steps succeeded, which failed, and the output of each step. Useful for debugging a workflow that isn’t behaving as expected.- Execution ID and timestamp
- Step-by-step execution trace
- Success/failure status for each step
- Output and error messages
- Total duration
applad workflows pause
Pauses a workflow so it stops accepting new trigger events. Any currently running executions complete normally. New trigger events are dropped while paused. Use this to temporarily disable a workflow without deleting it.applad workflows resume
Resumes a paused workflow. It starts accepting new trigger events again immediately.Workflow Definition
Workflows are defined in yaml files in theworkflows/ directory. Each workflow specifies:
- Trigger: What starts the workflow (event, schedule, or manual)
- Steps: Sequential or parallel actions to execute
- Conditions: Logic to control flow
- Error handling: What to do when steps fail
Common Workflow Patterns
Event-triggered workflows
Workflows that run in response to database events, auth events, or custom events.Scheduled workflows
Workflows that run on a schedule using cron syntax.Multi-step sequences
Workflows with delays, conditions, and branching logic.Examples
Test a workflow manually
Debug a failing workflow
Temporarily disable a workflow
Monitor workflow executions
Create a new workflow with instruct
Workflow Steps
Workflows can include various step types:Send messages
Invoke functions
Delays
Conditions
Parallel execution
Best Practices
- Test with
trigger: Always test workflows manually before relying on automatic triggers - Check logs regularly: Use
workflows logsto monitor execution and catch issues early - Use pausing wisely: Pause workflows during maintenance or when debugging issues
- Keep steps simple: Break complex logic into separate functions that workflows call
- Handle failures gracefully: Define error handling and retry logic for critical workflows
- Monitor execution times: Long-running workflows may need optimization or parallelization
Related Commands
applad functions- Manage functions that workflows can invokeapplad messaging- Configure messaging channels used by workflowsapplad instruct- Use AI to create and modify workflows