Skip to main content

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:
Use cases:
  • Receive data from external APIs
  • Create custom integrations
  • Build real-time automations

2. Schedule Trigger

Runs on a schedule using cron expressions:
Use cases:
  • Daily reports
  • Periodic data syncs
  • Scheduled notifications
  • Maintenance tasks

3. App Event Trigger

Triggers from specific application events:
Examples:
  • 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:
Use cases:
  • 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

  1. Create/Edit Flow: Start with a draft version
  2. Test: Run test executions without publishing
  3. Publish: Lock the version and make it live
  4. Edit Again: Creates a new draft while the locked version keeps running
  5. 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:
  1. Trigger fires: Event occurs (webhook received, schedule hits, etc.)
  2. Steps execute sequentially: Each action runs in order
  3. Data flows forward: Each step can access outputs from previous steps
  4. 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