Understanding Workflows
In Activepieces, workflows are called flows. A flow is an automated sequence of steps that executes when triggered. Flows are the core building blocks of automation in Activepieces.What is a Flow?
A flow represents a complete automation workflow. Each flow consists of:- One Trigger: The event that starts the flow
- Multiple Actions: Steps that execute in sequence
- Version Control: Draft and locked versions for safe deployments
- Metadata: Display name, owner, folder, and settings
Flow Structure
Based on the Activepieces source code, here’s the structure of a flow:Flow Status
Flows can be in one of two states:- ENABLED: The flow is active and will execute when triggered
- DISABLED: The flow is inactive and won’t execute
When you disable a flow, existing scheduled or queued runs will complete, but no new runs will start.
Triggers
Triggers determine when a flow executes. Every flow must have exactly one trigger.Trigger Types
Activepieces supports several trigger types:1. Webhook Trigger
Receives HTTP requests from external services:- Receive data from external APIs
- Create custom integrations
- Build real-time automations
2. Schedule Trigger
Runs on a schedule using cron expressions:- Daily reports
- Periodic data syncs
- Scheduled notifications
- Maintenance tasks
3. App Event Trigger
Triggers from specific application events:- New email in Gmail
- New row in Google Sheets
- New message in Slack
- Form submission
- Database update
4. MCP Tool Trigger
Exposes your flow as an MCP (Model Context Protocol) server tool:- Make flows callable from Claude Desktop
- Integrate with Cursor or Windsurf
- Create AI-accessible tools
MCP triggers allow AI assistants to call your Activepieces flows as tools, enabling powerful AI-human-tool collaboration.
Actions
Actions are the steps that execute after a trigger fires. Flows can have any number of actions, and they execute sequentially.Action Types
1. Piece Action
Use an integration from the Activepieces ecosystem:2. Code Action
Write custom TypeScript/JavaScript with npm support:3. Loop Action
Iterate over arrays:4. Branch Action
Conditional logic (if/else):5. HTTP Request
Make API calls to any service:Flow Versions
Activepieces maintains versions of your flows to ensure safe deployments:Version Workflow
- Create/Edit Flow: Start with a draft version
- Test: Run test executions without publishing
- Publish: Lock the version and make it live
- Edit Again: Creates a new draft while the locked version keeps running
- Publish Update: Replace the locked version with the new draft
This versioning system ensures your production flows continue running while you make and test changes.
Referencing Data Between Steps
Activepieces uses a template syntax to reference data from previous steps:Flow Execution
When a flow runs:- Trigger fires: Event occurs (webhook received, schedule hits, etc.)
- Steps execute sequentially: Each action runs in order
- Data flows forward: Each step can access outputs from previous steps
- Execution completes: Final status is SUCCESS or FAILED
Execution State
The platform maintains execution state including:- Current step being executed
- Input and output of each step
- Error messages if steps fail
- Total execution time
- Webhook handshake configuration
Best Practices
Descriptive Names
Use clear, descriptive names for flows and steps so teammates understand what they do.
Test Before Publishing
Always test flows thoroughly before enabling them in production.
Use Folders
Organize related flows in folders for easier management.
Add Error Handling
Use branches to handle errors gracefully and send notifications when issues occur.
Document with Notes
Add notes to complex steps to help future maintainers.
Monitor Executions
Regularly check execution logs to catch and fix issues early.
Next Steps
- Learn about Pieces - Understand the integration framework
- Build with AI - Create intelligent workflows
- MCP Integration - Connect flows to AI assistants
- Advanced Flow Building - Master complex patterns