> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the Activepieces MCP server

The Activepieces MCP connector routes your AI agent's tool calls to Activepieces's own MCP server through Scalekit. Each user signs in to Activepieces once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 47 tools.

**Authentication:** OAuth2.1/DCR
**Categories:** Automation
**Tools:** 47: 19 read, 22 write, 6 destructive
**Users sign in with:** OAuth
**OAuth app:** Scalekit's or your own
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=ACTIVEPIECESMCP)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Activepieces MCP connection

   In **AgentKit > Connections**, create an Activepieces MCP connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   Scalekit credentials are available for Activepieces MCP server, so you don't need to register an OAuth app.

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'activepiecesmcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Activepieces MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'activepiecesmcp_ap_list_ai_models',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "activepiecesmcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Activepieces MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="activepiecesmcp_ap_list_ai_models",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'activepiecesmcp_ap_find_records',
  toolInput: {
    tableId: '<tableId>',
  },
  connector: 'activepiecesmcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="activepiecesmcp_ap_find_records",
    tool_input={
        "tableId": "<tableId>",
    },
    connection_name="activepiecesmcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `activepiecesmcp_ap_find_records`

FindRecords · Read-only

Query records from a table with optional filtering. Operators: eq, neq, gt, gte, lt, lte, co, exists, not_exists.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `tableId` (`string`, required): The table ID. Use ap_list_tables to find it.
- `filters` (`array`, optional): Optional filters. All filters are combined with AND logic.
- `limit` (`number`, optional): Max records to return (default 50, max 500). Default: `50`.

Example input: `{"tableId":"<tableId>"}`

### `activepiecesmcp_ap_flow_structure`

FlowStructure · Read-only

Get the structure of a flow: step tree (parent/child), each step type, configuration status (configured/unconfigured/invalid), and valid insert locations for ap_add_step.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flowId` (`string`, required): The id of the flow

Example input: `{"flowId":"<flowId>"}`

### `activepiecesmcp_ap_get_piece_props`

GetPieceProps · Read-only

Get the input schema for a piece action or trigger, plus AI guidance for using it: an AI-written description of what it does, an idempotency hint, and — when available — the output field paths it produces (for triggers, also derived from sample data). Use the AI description to pick the right action; when output fields are listed, reference them directly downstream as {{step['output'].path}}. Pass auth to resolve dynamic dropdowns and dynamic property sub-fields (e.g. Custom API Call url/body fields).

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `actionOrTriggerName` (`string`, required): The action or trigger name (e.g. "send_channel_message"). Use ap_research_pieces with pieceNames to get valid values.
- `pieceName` (`string`, required): The piece name (e.g. "@activepieces/piece-slack"). Use ap_research_pieces to get valid values.
- `type` (`string`, required): Whether to look up an action or a trigger. One of: `action`, `trigger`.
- `auth` (`string`, optional): Connection externalId from ap_list_connections. When provided, dynamic dropdowns and dynamic property sub-fields are resolved via your account.
- `flowId` (`string`, optional): Flow ID for resolving dependent dropdowns that need step context. Optional — most dropdowns work without it.
- `input` (`object`, optional): Known input values to resolve dependent dynamic properties.

Example input: `{"actionOrTriggerName":"send_channel_message","pieceName":"@activepieces/piece-slack","type":"action"}`

### `activepiecesmcp_ap_get_run`

GetRun · Read-only

Get detailed results of a flow run including step-by-step outputs, errors, and durations.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flowRunId` (`string`, required): The ID of the flow run. Use ap_list_runs to find it.

Example input: `{"flowRunId":"<flowRunId>"}`

### `activepiecesmcp_ap_list_ai_models`

ListAiModels · Read-only

List configured AI providers and their available models. Use this to discover valid provider and model values for configuring Run Agent steps. The output shows provider names and model IDs needed for the aiProviderModel input.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `provider` (`string`, optional): Filter by provider name. Omit to list all configured providers and their models. One of: `openai`, `openrouter`, `anthropic`, `azure`, `google`, `activepieces`, `cloudflare-gateway`, `custom`, `bedrock`, `vertex`, `mistral`, `xai`, `deepseek`, `zai`, `qwen`, `minimax`, `moonshot`.

Example input: `{}`

### `activepiecesmcp_ap_list_connections`

ListConnections · Read-only

List OAuth/app connections in the project. Returns externalId needed for the auth parameter on steps.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `displayName` (`string`, optional): Filter by connection display name (partial, case-insensitive match). Use to find a connection by its label, e.g. "My Gmail" or "Slack workspace".
- `pieceName` (`string`, optional): Filter by piece name. Short names like "slack" or "google-drive" are auto-expanded to full format (e.g. "@activepieces/piece-slack"). You can also pass the full name directly.
- `status` (`array`, optional): Filter by status: ACTIVE (working), MISSING (deleted or inaccessible), ERROR (auth/refresh failed). Omit to return all statuses.

Example input: `{}`

### `activepiecesmcp_ap_list_flows`

ListFlows · Read-only

List flows in the current project with status, trigger type, and published state.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`integer`, optional): Max flows to return (default 100, max 500). Default: `100`.
- `name` (`string`, optional): Filter by flow name (partial match).
- `status` (`string`, optional): Filter by status: ENABLED or DISABLED. One of: `ENABLED`, `DISABLED`.

Example input: `{}`

### `activepiecesmcp_ap_list_runs`

ListRuns · Read-only

List recent flow runs with optional filters. Returns run ID, status, timestamps, and failed step info.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `environment` (`string`, optional): Filter by environment: PRODUCTION (live runs) or TESTING (manual test runs). Defaults to PRODUCTION when no flowId is given, since cross-environment scans on the runs table are slow. One of: `PRODUCTION`, `TESTING`.
- `flowId` (`string`, optional): Filter by flow ID. Use ap_list_flows to find it.
- `limit` (`number`, optional): Max runs to return (default 10, max 50). Default: `10`.
- `status` (`string`, optional): Filter by status: SUCCEEDED, FAILED, RUNNING, QUEUED, PAUSED, TIMEOUT, etc. One of: `FAILED`, `QUOTA_EXCEEDED`, `INTERNAL_ERROR`, `PAUSED`, `QUEUED`, `RUNNING`, `SUCCEEDED`, `MEMORY_LIMIT_EXCEEDED`, `TIMEOUT`, `CANCELED`, `LOG_SIZE_EXCEEDED`.

Example input: `{}`

### `activepiecesmcp_ap_list_tables`

ListTables · Read-only

List all tables in the current project with their fields (name, type, id) and row counts. Use this to discover available tables before querying or modifying data. Each table has two ids: use "id" with the record/field MCP tools (ap_insert_records, ap_find_records, ap_manage_fields, etc.), and use "externalId" as the table_id value when configuring a Tables piece step inside a flow.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `activepiecesmcp_ap_read_step_code`

ReadStepCode · Read-only

Read the full source code, package.json, and input of a CODE step. Returns untruncated content (unlike ap_flow_structure which truncates).

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flowId` (`string`, required): The id of the flow
- `stepName` (`string`, required): The name of the CODE step (e.g. "step_1"). Use ap_flow_structure to get valid values.

Example input: `{"flowId":"<flowId>","stepName":"step_1"}`

### `activepiecesmcp_ap_read_step_settings`

ReadStepSettings · Read-only

Read the full untruncated settings of any step, including the trigger: piece input, action/trigger name, loop items, router branches, and error handling options. Use this to see a step's current configuration before updating it (ap_flow_structure truncates piece input). For reviewing a CODE step's source, prefer ap_read_step_code.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flowId` (`string`, required): The id of the flow
- `stepName` (`string`, required): The name of the step (e.g. "trigger", "step_1"). Use ap_flow_structure to get valid values.

Example input: `{"flowId":"<flowId>","stepName":"trigger"}`

### `activepiecesmcp_ap_research_pieces`

ResearchPieces · Read-only

Research available pieces. Use pieceNames for bulk exact lookup (always returns actions and triggers, each with an AI guidance hint). Use searchQuery for fuzzy discovery. Pass forIntent with what you are trying to do to get recommendedActions ranked by AI guidance, so you pick the right action in one shot.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `categories` (`array`, optional): No description.
- `forIntent` (`string`, optional): What you are trying to do (e.g. "list all my open deals"). When set, each piece also returns recommendedActions — the actions whose AI guidance best matches your intent — so you can pick the right action in one shot. Advisory only; the full action list is always returned.
- `includeActions` (`boolean`, optional): When true, include action names and descriptions for each piece (only applies to searchQuery mode)
- `includeTriggers` (`boolean`, optional): When true, include trigger names and descriptions for each piece (only applies to searchQuery mode)
- `locale` (`string`, optional): No description. One of: `nl`, `en`, `de`, `fr`, `es`, `ja`, `zh`, `pt`, `ar`, `zh-TW`.
- `pieceNames` (`array`, optional): Exact piece names to look up (e.g. ["gmail", "slack", "@activepieces/piece-google-sheets"]). Always returns actions and triggers for each piece.
- `searchQuery` (`string`, optional): No description.
- `suggestionType` (`string`, optional): No description. One of: `ACTION`, `TRIGGER`, `ACTION_AND_TRIGGER`.

Example input: `{}`

### `activepiecesmcp_ap_resolve_property_chain`

ResolvePropertyChain · Read-only

Resolve a chain of dependent dropdown properties in one call. For actions with cascading fields (e.g. Spreadsheet -> Sheet -> Columns), this resolves each property sequentially, feeding each selected value into the next resolution. Pass selectedValue for properties whose value you already know; the tool stops and returns options when it hits a property without a selectedValue. Always use the value from returned options, not the label.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `actionOrTriggerName` (`string`, required): The action or trigger name (e.g. "insert_row").
- `auth` (`string`, required): Connection externalId - required to resolve options from the user's account.
- `pieceName` (`string`, required): The piece name (e.g. "@activepieces/piece-google-sheets").
- `propertyChain` (`array`, required): Ordered list of properties to resolve (max 10). Each property is resolved using the values of all prior properties as context.
- `type` (`string`, required): Whether this is an action or trigger. One of: `action`, `trigger`.
- `currentInput` (`object`, optional): Additional input values already known (e.g. from prior configuration).

Example input: `{"actionOrTriggerName":"insert_row","auth":"<auth>","pieceName":"@activepieces/piece-google-sheets","propertyChain":[],"type":"action"}`

### `activepiecesmcp_ap_resolve_property_options`

ResolvePropertyOptions · Read-only

Resolve dropdown options for a single piece property. Returns the available options with labels and values (IDs). Use this to discover valid values for DROPDOWN fields (e.g. Slack channels, Google Sheets, email labels). Always use the `value` from the returned options, not the `label`.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `actionOrTriggerName` (`string`, required): The action or trigger name (e.g. "send_channel_message").
- `pieceName` (`string`, required): The piece name (e.g. "@activepieces/piece-slack").
- `propertyName` (`string`, required): The exact property name to resolve options for (e.g. "channel").
- `type` (`string`, required): Whether this is an action or trigger. One of: `action`, `trigger`.
- `auth` (`string`, optional): Connection externalId. Required for pieces that resolve options from a connected account (e.g. Slack channels, Gmail labels). Omit for pieces that have no auth (e.g. Tables table_id) — passing a value there is unnecessary.
- `input` (`object`, optional): Values for parent properties that this field depends on (refreshers).
- `searchValue` (`string`, optional): Search/filter term to narrow results for large dropdown lists (e.g., "sales" to find sales-related channels).

Example input: `{"actionOrTriggerName":"send_channel_message","pieceName":"@activepieces/piece-slack","propertyName":"channel","type":"action"}`

### `activepiecesmcp_ap_search_actions`

SearchActions · Read-only

Find piece actions by natural-language task description (e.g. "send a message to a Slack channel"). Returns the most semantically relevant actions ranked by similarity — lightweight rows only — or an empty list when nothing in the catalog is relevant (it does not force a match). Falls back to keyword catalog search when no embedding model is configured. Each row carries a `connected` flag indicating whether this project already has a connection for the piece. This is the discovery step: take a result's pieceName + actionName to ap_get_piece_props for its input schema, then ap_run_action to execute it.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): Natural-language description of the task to accomplish (e.g. "send a message to a Slack channel", "create a Google Calendar event").
- `limit` (`integer`, optional): Maximum number of action matches to return. Defaults to 5. Default: `5`.
- `pieceName` (`string`, optional): Restrict results to a single piece (e.g. "slack" or "@activepieces/piece-slack"). Omit to search the whole catalog.

Example input: `{"query":"send a message to a Slack channel"}`

### `activepiecesmcp_ap_search_triggers`

SearchTriggers · Read-only

Find piece triggers (the event that starts a flow) by natural-language description of when the flow should run (e.g. "when a new row is added to a Google Sheet", "when an email arrives"). Returns the most semantically relevant triggers ranked by similarity — lightweight rows only — or an empty list when nothing in the catalog is relevant (it does not force a match). Falls back to keyword catalog search when no embedding model is configured. Each row carries a `connected` flag indicating whether this project already has a connection for the piece. This is the discovery step: take a result's pieceName + triggerName to ap_get_piece_props for its input schema.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): Natural-language description of the event that should start the flow (e.g. "when a new row is added to a Google Sheet", "when a new email arrives").
- `limit` (`integer`, optional): Maximum number of trigger matches to return. Defaults to 5. Default: `5`.
- `pieceName` (`string`, optional): Restrict results to a single piece (e.g. "slack" or "@activepieces/piece-slack"). Omit to search the whole catalog.

Example input: `{"query":"when a new row is added to a Google Sheet"}`

### `activepiecesmcp_ap_setup_guide`

SetupGuide · Read-only

Get setup instructions for connections or AI providers. Returns steps for the user to follow in the UI.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `topic` (`string`, required): What to get setup instructions for. One of: `connection`, `ai_provider`.
- `pieceName` (`string`, optional): For connections: the piece that needs auth (e.g., "@activepieces/piece-gmail"). Omit for general instructions.

Example input: `{"topic":"connection"}`

### `activepiecesmcp_ap_validate_flow`

ValidateFlow · Read-only

Validate a flow for structural issues without publishing. Checks step validity, template references, and empty branches. Returns a detailed report with all issues found. Use this before ap_lock_and_publish to catch problems early.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flowId` (`string`, required): The id of one flow to validate. Use ap_list_flows to find it.
- `folderName` (`string`, optional): The folder holding a solution of several flows and tables (as created with ap_create_folder), to validate all of them and the connections between them.

Example input: `{"flowId":"<flowId>"}`

### `activepiecesmcp_ap_validate_step_config`

ValidateStepConfig · Read-only

Validate a step configuration before applying it. Returns field-level errors without modifying any flow. Use this to check your config is correct before calling ap_update_step or ap_update_trigger.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `stepType` (`string`, required): The type of step to validate. One of: `PIECE_ACTION`, `PIECE_TRIGGER`, `CODE`, `LOOP_ON_ITEMS`, `ROUTER`.
- `actionName` (`string`, optional): For PIECE_ACTION: action name (e.g. "send_channel_message").
- `auth` (`string`, optional): For PIECE steps requiring auth: any non-empty string indicates auth is provided.
- `input` (`object`, optional): For PIECE_ACTION/PIECE_TRIGGER: the input config to validate (key-value pairs).
- `loopItems` (`string`, optional): For LOOP_ON_ITEMS: expression for items to iterate over.
- `packageJson` (`string`, optional): For CODE: package.json content as JSON string. Default: `{}`.
- `pieceName` (`string`, optional): For PIECE_ACTION/PIECE_TRIGGER: piece name (e.g. "slack" or "@activepieces/piece-slack").
- `settings` (`object`, optional): For ROUTER: raw router settings including branches and executionType.
- `sourceCode` (`string`, optional): For CODE: the JavaScript/TypeScript source code.
- `triggerName` (`string`, optional): For PIECE_TRIGGER: trigger name (e.g. "new_mention").

Example input: `{"stepType":"PIECE_ACTION"}`

### `activepiecesmcp_ap_add_branch`

AddBranch · Write

Add a conditional branch to a router step. Inserted before the fallback branch.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `branchName` (`string`, required): Display name for the new branch (e.g. "Branch 1")
- `flowId` (`string`, required): The id of the flow
- `routerStepName` (`string`, required): The name of the ROUTER step to add a branch to. Use ap_flow_structure to get valid values.
- `conditions` (`array`, optional): Conditions array (outer array = OR groups, inner array = AND conditions). Required for condition-type branches; omit to use an empty condition group.

Example input: `{"branchName":"Branch 1","flowId":"<flowId>","routerStepName":"<routerStepName>"}`

### `activepiecesmcp_ap_add_step`

AddStep · Write

Add a new step to a flow. Optionally configure it in the same call by providing input/auth/sourceCode. Prefer PIECE actions and inline formula expressions over CODE.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `displayName` (`string`, required): Display name for the step
- `flowId` (`string`, required): The id of the flow
- `parentStepName` (`string`, required): The step name to insert after/into (e.g. "trigger", "step_1"). Use ap_flow_structure to get valid values.
- `stepLocationRelativeToParent` (`string`, required): Where to place the step: AFTER = after the parent, INSIDE_LOOP = first action inside a loop, INSIDE_BRANCH = first action inside a router branch, INSIDE_ON_SUCCESS_BRANCH / INSIDE_ON_FAILURE_BRANCH = first action inside the On success / On failure branch of a continue-on-failure step (set continueOnFailure on the parent first). One of: `AFTER`, `INSIDE_LOOP`, `INSIDE_BRANCH`, `INSIDE_ON_SUCCESS_BRANCH`, `INSIDE_ON_FAILURE_BRANCH`.
- `stepType` (`string`, required): The type of step to add. Prefer PIECE over CODE - only use CODE when no piece fits and the logic can't be done with an inline formula expression (in a free-text/value input) or a router condition. One of: `CODE`, `PIECE`, `LOOP_ON_ITEMS`, `ROUTER`.
- `actionName` (`string`, optional): For PIECE steps: the action name within the piece. Use ap_research_pieces with includeActions=true to get valid values.
- `auth` (`string`, optional): Connection externalId from ap_list_connections. Auto-wrapped as {{connections['externalId']}}.
- `branchIndex` (`number`, optional): Branch index (required when stepLocationRelativeToParent is INSIDE_BRANCH)
- `continueOnFailure` (`boolean`, optional): For CODE/PIECE steps: set true on the step that can fail (the one whose failure you want to react to), NOT on the recovery step. Defaults to false. When true the flow keeps running on failure and the step gains On success / On failure branches - add handler steps into them with stepLocationRelativeToParent INSIDE_ON_SUCCESS_BRANCH / INSIDE_ON_FAILURE_BRANCH and parentStepName = this step. Default: `false`.
- `input` (`object`, optional): For PIECE/CODE steps: input config (key-value pairs). Reference a prior step's output with {{stepName['output'].field}} (output is nested under ['output'], e.g. {{trigger['output'].body.email}}, {{send_email['output'].id}}). For a continue-on-failure step's error, use {{stepName['error'].message}}.
- `loopItems` (`string`, optional): For LOOP steps: expression for items to iterate (e.g. "{{step_1['output'].items}}").
- `packageJson` (`string`, optional): For CODE steps: package.json as JSON string. Defaults to "{}". Default: `{}`.
- `pieceName` (`string`, optional): For PIECE steps: the piece name (e.g. "@activepieces/piece-gmail"). Use ap_research_pieces to get valid values.
- `retryOnFailure` (`boolean`, optional): For CODE/PIECE steps: whether to retry this step on failure. Defaults to false. Default: `false`.
- `sourceCode` (`string`, optional): For CODE steps: JavaScript/TypeScript source. Must export a code function.

Example input: `{"displayName":"My Gmail","flowId":"<flowId>","parentStepName":"trigger","stepLocationRelativeToParent":"AFTER","stepType":"CODE"}`

### `activepiecesmcp_ap_build_flow`

BuildFlow · Write

Create a NEW flow from scratch in one call: trigger + steps. Steps are added sequentially by default (trigger → step_1 → step_2 → ...). To nest steps inside a loop, set parentStepName to the loop step name and stepLocationRelativeToParent to INSIDE_LOOP. ROUTER steps are NOT supported here (branches and conditions cannot be configured in one call) — build the rest of the flow first, then add the router with ap_add_step and configure branches with ap_add_branch / ap_update_branch. For EDITING an existing flow, do NOT rebuild it — use the granular ap_add_step / ap_update_step / ap_update_trigger instead. Prefer PIECE actions and inline formula expressions (in a free-text/value input — never a dropdown/option field — wrapped `ap-formula-v1::{...}::ap-formula-v1`) over CODE steps — only emit a CODE step when no piece fits AND the logic exceeds the inline formula functions (see the build_flow guide expression ladder).

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowName` (`string`, required): Name for the new flow
- `steps` (`array`, required): Array of steps. By default added sequentially after trigger. Use parentStepName + stepLocationRelativeToParent to nest steps inside loops. Each step supports: PIECE (pieceName+actionName+input), CODE (sourceCode+input), LOOP_ON_ITEMS (loopItems). Prefer PIECE and inline formula expressions (in free-text/value inputs, not dropdowns) over CODE â reach for a CODE step only when no piece fits and the transform exceeds the inline formula functions. ROUTER is not supported here â add it afterwards with ap_add_step + ap_add_branch.
- `trigger` (`object`, required): Trigger configuration
- `folderName` (`string`, optional): Name of an existing folder to place it in. For a solution of several flows and tables, create the folder with ap_create_folder in an earlier step than the calls that use it (never in the same step, they run at once), then pass the same folderName to each of them.

Example input: `{"flowName":"<flowName>","steps":[],"trigger":{}}`

### `activepiecesmcp_ap_change_flow_status`

ChangeFlowStatus · Write

Enable or disable a published flow.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flowId` (`string`, required): The id of the flow
- `status` (`string`, required): The new status: ENABLED to activate the flow, DISABLED to pause it. One of: `ENABLED`, `DISABLED`.

Example input: `{"flowId":"<flowId>","status":"ENABLED"}`

### `activepiecesmcp_ap_create_flow`

CreateFlow · Write

Create a new flow in Activepieces.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowName` (`string`, required): The name of the flow
- `folderName` (`string`, optional): Name of an existing folder to place it in. For a solution of several flows and tables, create the folder with ap_create_folder in an earlier step than the calls that use it (never in the same step, they run at once), then pass the same folderName to each of them.

Example input: `{"flowName":"<flowName>"}`

### `activepiecesmcp_ap_create_folder`

Ap Create Folder · Write

Create a folder to hold one solution's flows and tables, or get it if a folder with that name already exists. Call it once before building a solution of several flows and tables, then pass the same folderName to ap_create_flow, ap_build_flow and ap_create_table.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `folderName` (`string`, required): The folder name, e.g. the solution being built ("Order intake")

Example input: `{"folderName":"<folderName>"}`

### `activepiecesmcp_ap_create_table`

CreateTable · Write

Create a new table with an initial set of fields. Types: TEXT, NUMBER, DATE, STATIC_DROPDOWN.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `fields` (`array`, required): Fields to create. Max 100 fields per table.
- `name` (`string`, required): The name of the table
- `folderName` (`string`, optional): Name of an existing folder to place it in. For a solution of several flows and tables, create the folder with ap_create_folder in an earlier step than the calls that use it (never in the same step, they run at once), then pass the same folderName to each of them.

Example input: `{"fields":[],"name":"<name>"}`

### `activepiecesmcp_ap_duplicate_flow`

DuplicateFlow · Write

Duplicate an existing flow. Creates a new copy with all steps and configuration. Connections and sample data are not copied.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowId` (`string`, required): The id of the flow to duplicate. Use ap_list_flows to find it.
- `name` (`string`, optional): Name for the duplicated flow. Defaults to "Copy of {original name}".

Example input: `{"flowId":"<flowId>"}`

### `activepiecesmcp_ap_insert_records`

InsertRecords · Write

Insert one or more records into a table. Max 50 records per call.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `records` (`array`, required): Array of records (1-50). Each record maps field names to values. Example: [{"Name": "Alice", "Age": "30"}]
- `tableId` (`string`, required): The table ID (the "id" from ap_list_tables; the externalId is also accepted).

Example input: `{"records":[{"Name":"Alice","Age":"30"}],"tableId":"<tableId>"}`

### `activepiecesmcp_ap_list_folders`

Ap List Folders · Write

List the folders in the current project with how many flows and tables each holds. Use it to reuse an existing folder name instead of creating a near-duplicate.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs: none.

Example input: `{}`

### `activepiecesmcp_ap_lock_and_publish`

LockAndPublish · Write

Publish and enable the current draft version of a flow. This locks the draft, sets it as the published version, and enables the flow. Returns validation errors if the flow is not ready.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowId` (`string`, required): The id of the flow to publish

Example input: `{"flowId":"<flowId>"}`

### `activepiecesmcp_ap_manage_fields`

ManageFields · Write

Add, rename, or delete fields on a table. Max 100 fields per table.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `operation` (`string`, required): ADD a new field, UPDATE (rename) an existing field, or DELETE a field. One of: `ADD`, `UPDATE`, `DELETE`.
- `tableId` (`string`, required): The table ID
- `fieldId` (`string`, optional): The field ID (required for UPDATE and DELETE). Use ap_list_tables to find it.
- `name` (`string`, optional): Field name (required for ADD and UPDATE)
- `options` (`array`, optional): Dropdown options (required for ADD with STATIC_DROPDOWN type)
- `type` (`string`, optional): Field type (required for ADD only). One of: `TEXT`, `NUMBER`, `DATE`, `DATETIME`, `STATIC_DROPDOWN`.

Example input: `{"operation":"ADD","tableId":"<tableId>"}`

### `activepiecesmcp_ap_manage_notes`

ManageNotes · Write

Add, update, or delete canvas notes on a flow. Notes are visual annotations on the flow canvas.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowId` (`string`, required): The id of the flow
- `operation` (`string`, required): Operation to perform: ADD a new note, UPDATE an existing note, or DELETE a note. One of: `ADD`, `UPDATE`, `DELETE`.
- `color` (`string`, optional): Note color variant (orange, red, green, blue, purple, yellow). Default: yellow. One of: `orange`, `red`, `green`, `blue`, `purple`, `yellow`. Default: `yellow`.
- `content` (`string`, optional): The text content of the note (required for ADD, optional for UPDATE)
- `noteId` (`string`, optional): The note ID (required for UPDATE and DELETE)
- `position` (`object`, optional): Position on the canvas (required for ADD, optional for UPDATE)
- `size` (`object`, optional): Size of the note (optional, defaults to 200x200)

Example input: `{"flowId":"<flowId>","operation":"ADD"}`

### `activepiecesmcp_ap_move_flow_to_folder`

Ap Move Flow To Folder · Write

Move a flow into a folder, creating the folder when no folder has that name, or take it out of its folder with uncategorized=true. Pass exactly one of folderName or uncategorized.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowId` (`string`, required): The id of the flow to move
- `folderName` (`string`, optional): The folder to move the flow into. An existing folder is matched case-insensitively; a new one is created when no folder has this name.
- `uncategorized` (`boolean`, optional): true to take the flow out of its folder

Example input: `{"flowId":"<flowId>"}`

### `activepiecesmcp_ap_rename_flow`

RenameFlow · Write

Rename a flow.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `displayName` (`string`, required): The new display name for the flow
- `flowId` (`string`, required): The id of the flow to rename

Example input: `{"displayName":"My Gmail","flowId":"<flowId>"}`

### `activepiecesmcp_ap_retry_run`

RetryRun · Write

Retry a failed flow run. FROM_FAILED_STEP resumes at failure point, ON_LATEST_VERSION re-runs entirely.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowRunId` (`string`, required): The ID of the failed flow run to retry. Use ap_list_runs to find it.
- `strategy` (`string`, required): FROM_FAILED_STEP to resume where it failed, ON_LATEST_VERSION to re-run with the current published flow. One of: `ON_LATEST_VERSION`, `FROM_FAILED_STEP`.

Example input: `{"flowRunId":"<flowRunId>","strategy":"ON_LATEST_VERSION"}`

### `activepiecesmcp_ap_test_flow`

TestFlow · Write

Test a flow end-to-end in the test environment. Requires a configured trigger. Waits up to 120s. Pass triggerTestData to provide mock trigger output when no sample data exists.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowId` (`string`, required): The ID of the flow to test. Use ap_list_flows to find it.
- `displayName` (`string`, optional): Short approval prompt shown to the user (e.g. "Test Send Welcome Email"). Must include what the action does and the target name.
- `triggerTestData` (`object`, optional): Mock trigger output data. Saved as sample data before running the test. Useful when the trigger has no prior test data.

Example input: `{"flowId":"<flowId>"}`

### `activepiecesmcp_ap_test_step`

TestStep · Write

Test a single step within a flow. Runs all steps up to and including the specified step. The flow must have a configured trigger. Pass triggerTestData when no sample data exists.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `flowId` (`string`, required): The ID of the flow containing the step. Use ap_list_flows to find it.
- `stepName` (`string`, required): The name of the step to test (e.g., "step_1"). Use ap_flow_structure to find it.
- `displayName` (`string`, optional): Short approval prompt shown to the user (e.g. "Test Send Email step in Welcome Flow"). Must include what the action does and the target name.
- `triggerTestData` (`object`, optional): Mock trigger output data. Saved as sample data before running the test. Useful when the trigger has no prior test data.

Example input: `{"flowId":"<flowId>","stepName":"step_1"}`

### `activepiecesmcp_ap_update_branch`

UpdateBranch · Write

Update the conditions and/or name of an existing router branch. Does not affect the steps inside the branch.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `branchIndex` (`number`, required): The index of the branch to update (0-based). Cannot update the fallback branch conditions.
- `flowId` (`string`, required): The id of the flow
- `routerStepName` (`string`, required): The name of the ROUTER step. Use ap_flow_structure to get valid values.
- `branchName` (`string`, optional): New display name for the branch
- `conditions` (`array`, optional): New conditions array (outer array = OR groups, inner array = AND conditions). Replaces the existing conditions entirely.

Example input: `{"branchIndex":1,"flowId":"<flowId>","routerStepName":"<routerStepName>"}`

### `activepiecesmcp_ap_update_record`

UpdateRecord · Write

Update specific cells in a record. Only specified fields are changed.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `fields` (`object`, required): Object mapping field names to new values. Only specified fields are updated. Example: {"Name": "Bob", "Age": "25"}
- `recordId` (`string`, required): The record ID to update. Use ap_find_records to find it.
- `tableId` (`string`, required): The table ID.

Example input: `{"fields":{"Name":"Bob","Age":"25"},"recordId":"<recordId>","tableId":"<tableId>"}`

### `activepiecesmcp_ap_update_step`

UpdateStep · Write

Update an existing step's settings. Provide only the fields you want to change.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flowId` (`string`, required): The id of the flow
- `stepName` (`string`, required): The name of the step to update (e.g. "step_1"). Use ap_flow_structure to get valid values.
- `actionName` (`string`, optional): For PIECE steps: the action to perform. Use ap_research_pieces to get valid values.
- `auth` (`string`, optional): Connection `externalId` from `ap_list_connections`. Pass the plain id, not a template.
- `continueOnFailure` (`boolean`, optional): For CODE/PIECE steps: set true on the step that can fail (the one whose failure you want to react to), NOT on the recovery step. The flow keeps running on failure and the step gains On success / On failure branches â add handler steps into them with ap_add_step using stepLocationRelativeToParent INSIDE_ON_SUCCESS_BRANCH / INSIDE_ON_FAILURE_BRANCH and parentStepName = this step.
- `displayName` (`string`, optional): New display name for the step
- `input` (`object`, optional): Input settings for the step (key-value pairs matching the action schema). Reference a prior step's output with {{stepName['output'].field}} (output is nested under ['output'], e.g. {{trigger['output'].body.email}}, {{send_email['output'].id}}). For a continue-on-failure step's error, use {{stepName['error'].message}}.
- `loopItems` (`string`, optional): For LOOP steps: expression for the items to iterate over
- `packageJson` (`string`, optional): For CODE steps only: package.json content as a JSON string for npm dependencies. Defaults to "{}".
- `pieceVersion` (`string`, optional): For PIECE steps: move the step to another version of its piece. Pass "latest" or an exact version like "1.2.3". Inputs the new version no longer has are dropped, so pass the adjusted input in the same call.
- `retryOnFailure` (`boolean`, optional): For CODE/PIECE steps: whether to retry this step on failure.
- `skip` (`boolean`, optional): Whether to skip this step during execution
- `sourceCode` (`string`, optional): For CODE steps only: the JavaScript/TypeScript source code. Must export a `code` function: `export const code = async (inputs) => { ... }`.

Example input: `{"flowId":"<flowId>","stepName":"step_1"}`

### `activepiecesmcp_ap_update_trigger`

UpdateTrigger · Write

Set or update the trigger for a flow.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flowId` (`string`, required): The id of the flow
- `pieceName` (`string`, required): The piece name for the trigger (e.g. "@activepieces/piece-gmail"). Use ap_research_pieces to get valid values.
- `triggerName` (`string`, required): The trigger name within the piece (e.g. "new_email"). Use ap_research_pieces with includeTriggers=true to get valid values.
- `auth` (`string`, optional): Connection externalId from ap_list_connections. The tool wraps it automatically as {{connections['externalId']}}.
- `displayName` (`string`, optional): Display name for the trigger step
- `input` (`object`, optional): Input settings for the trigger (key-value pairs). Reference a prior step's output with {{stepName['output'].field}} (output is nested under ['output'], e.g. {{trigger['output'].body.email}}, {{send_email['output'].id}}). For a continue-on-failure step's error, use {{stepName['error'].message}}.

Example input: `{"flowId":"<flowId>","pieceName":"@activepieces/piece-gmail","triggerName":"new_email"}`

### `activepiecesmcp_ap_delete_branch`

DeleteBranch · Destructive

Delete a branch from a router step. Cannot delete the fallback branch.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `branchIndex` (`number`, required): The index of the branch to delete (0-based). Cannot delete the fallback/last branch.
- `flowId` (`string`, required): The id of the flow
- `routerStepName` (`string`, required): The name of the ROUTER step. Use ap_flow_structure to get valid values.
- `displayName` (`string`, optional): Short approval prompt shown to the user (e.g. "Delete branch 2 from router"). Must include what the action does and the target name.

Example input: `{"branchIndex":1,"flowId":"<flowId>","routerStepName":"<routerStepName>"}`

### `activepiecesmcp_ap_delete_flow`

DeleteFlow · Destructive

Permanently delete a flow and all its versions. This cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `flowId` (`string`, required): The ID of the flow to delete

Example input: `{"flowId":"<flowId>"}`

### `activepiecesmcp_ap_delete_records`

DeleteRecords · Destructive

Permanently delete one or more records by their IDs.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `recordIds` (`array`, required): Array of record IDs to delete. Use ap_find_records to find them.
- `tableId` (`string`, required): ID of the table the records belong to. Use ap_find_records to find it.
- `displayName` (`string`, optional): Short approval prompt shown to the user (e.g. "Delete 3 records from Emails table"). Must include what the action does and the target name.

Example input: `{"recordIds":[],"tableId":"<tableId>"}`

### `activepiecesmcp_ap_delete_step`

DeleteStep · Destructive

Delete a step from a flow. Prefer ap_update_step to modify - delete destroys sample data.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `flowId` (`string`, required): The id of the flow
- `stepName` (`string`, required): The name of the step to delete. Use ap_flow_structure to get valid values.
- `displayName` (`string`, optional): Short approval prompt shown to the user (e.g. "Delete Send Email step"). Must include what the action does and the target name.

Example input: `{"flowId":"<flowId>","stepName":"step_1"}`

### `activepiecesmcp_ap_delete_table`

DeleteTable · Destructive

Permanently delete a table and all its data.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `tableId` (`string`, required): The ID of the table to delete. Use ap_list_tables to find it.
- `displayName` (`string`, optional): Short approval prompt shown to the user (e.g. "Delete Customer Emails table"). Must include what the action does and the target name.

Example input: `{"tableId":"<tableId>"}`

### `activepiecesmcp_ap_run_action`

RunAction · Destructive

Execute a single piece action once, without building or saving a flow. Use this for one-shot tasks like "check my inbox" or "send one Slack message". For recurring/triggered work, build a flow with ap_build_flow instead.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `actionName` (`string`, required): Action to run, e.g. "send_channel_message". Use ap_get_piece_props for the input shape.
- `input` (`object`, required): Fully-resolved input for the action. Keys must match the piece action's props. Pass raw values â do NOT wrap in {{...}}. Omit if the action has no props.
- `pieceName` (`string`, required): Piece name, e.g. "slack" or "@activepieces/piece-slack". Use ap_research_pieces to discover.
- `connectionExternalId` (`string`, optional): externalId from ap_list_connections. Required if the piece needs auth. Pass the plain id, not a template.

Example input: `{"actionName":"send_channel_message","input":{},"pieceName":"slack"}`

## Related

Other Automation connectors ([all 66](/agentkit/connectors/?category=automation)):

- [Mailchimp](/agentkit/connectors/mailchimp/): Scalekit connector, OAuth, 73 tools
- [Twilio](/agentkit/connectors/twilio/): Scalekit connector, Username and password, 61 tools
- [Stripe](/agentkit/connectors/stripe/): Scalekit connector, Access token, 178 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
