Skip to main content

What are Actions?

Actions are operations that users can perform in their flows. They take inputs (props), execute logic, and return outputs. Think of them as functions that can be called from automation workflows. Examples:
  • Send a message to Slack
  • Create an issue in GitHub
  • Upload a file to Google Drive
  • Query a database

Creating Your First Action

Use the CLI to generate an action:
You’ll be prompted for:
  • Piece name: Which piece to add the action to
  • Action name: Unique identifier (e.g., send_message)
  • Display name: Human-readable name (e.g., Send Message)
  • Description: What the action does

Action Structure

Here’s a real example from the GitHub piece:
packages/pieces/community/github/src/lib/actions/create-issue.ts

Action Configuration

string
required
Unique identifier for the action within the piece. Use snake_case.Example: send_message, create_issue, upload_file
string
required
Human-readable name shown in the UI. Use Title Case.Example: Send Message, Create Issue, Upload File
string
required
Brief description of what the action does. Shown as a tooltip.Example: Send a message to a Slack channel
PieceAuth
Authentication configuration. References the piece’s auth.
Record<string, Property>
required
Input properties that users configure. See Properties.
function
required
The main execution function. Receives context with auth and prop values.
function
Optional test function for validating the action works. If not provided, run is used for testing.
boolean
default:"true"
Whether authentication is required. Set to false for public APIs.

Complete Action Examples

Action Context

The context object passed to your run function contains:

Using Context

Error Handling

Provide clear error messages to help users debug issues:

Testing Actions

Test your action during development:
1

Start Dev Server

2

Create Test Flow

  1. Go to http://localhost:4200
  2. Create a new flow
  3. Add your action as a step
3

Configure & Test

  1. Fill in the required properties
  2. Click “Test” button
  3. Check the output
4

Iterate

Make changes to your action code - they’ll be reflected immediately thanks to hot reloading

Best Practices

Return structured data that can be used in subsequent steps:
Check inputs before making API calls:
Make property names clear and self-documenting:
Implement retry logic for rate-limited APIs:

Next Steps

Create Triggers

Learn how to create triggers

Properties Guide

Explore all property types

Testing

Write tests for your actions