# AI integrations and automation tools

Give agents configured operations that exchange information with APIs, scripts and connected automation services.

*Release 3.3 · admin, developer*

**Settings › AI › Functions** · **Settings › AI › Features** · **Settings › AI › Result Processors** · **Settings › AI › Connections**

## What it is

**API Call**, **Custom Script**, **MCP Tool** and **Activepieces Flow** let an agent use configured external operations. A function supplies the destination or operation, while the agent supplies the described arguments. Returned information can then support the agent's next action or answer.

## Who uses it and why

Users with the **Settings** or **Developer** role select which integrations an agent may use. Developers configure the requests, arguments and expected results, and arrange custom scripts with Powerfront where needed.

## Where to find it

Create operations under **Settings › AI › Functions** and assign them under **Settings › AI › Features** or through skills. Configure optional output processing under **Settings › AI › Result Processors**.

These screens require **Settings** with **AI** allowed under **Settings Permissions**, or **Developer**. Powerfront manages **Settings › AI › Connections**. Ask Powerfront to add or change the service connections you need.

## How it works

- **API Call** sends function arguments to the configured **URL**. **JSON** uses a POST request with a JSON body. **Query String** uses a GET request with encoded arguments appended to the address. Configured **Headers** accompany the request.
- **Custom Script** runs the selected configured script and returns its result. A missing script selection or a script that produces no result fails the operation.
- **MCP Tool** calls the selected **MCP Tool** on its **Tool Connection** and passes the generated arguments to that operation.
- **Activepieces Flow** invokes the selected flow on its configured service. It combines **Static Payload** with the generated arguments and waits for the service response. Generated arguments take precedence when names overlap.

For **API Call**, a successful response is read as JSON where possible. Other successful response content is returned as text. An unsuccessful HTTP response is a failed function call.

An optional **Result Processor** can add citation or guardrail information, or replace the result reused by the agent, depending on **Mode** and the execution path.

## Configure it

Choose the function type, give it a clear **Name** and **Description**, and define **Parameters** for the input the agent should generate.

For **API Call**, enter **URL**, choose **Type**, and add required **Headers**. For **Custom Script**, select **Custom Script**. For connected operations, ask Powerfront to prepare the connection, then select **Tool Connection** and **MCP Tool**, or **Activepieces Service** and **Flow**.

If an Activepieces flow needs constant values, add **Static Payload** entries. Keep their names distinct from generated parameters when the agent should not replace them. **Send API Key as Bearer token on webhook calls** starts enabled.

Select a **Result Processor** only where needed, enable the function and assign it to the intended feature or skill.

### Settings

| Setting | Where | Applies to | Default | Who can change it | What it does |
|---|---|---|---|---|---|
| Type | Settings › AI › Functions › API Call | website | JSON | Settings role, Developer role | Chooses a JSON POST request or a GET request with arguments in the query string. |
| Send API Key as Bearer token on webhook calls | Settings › AI › Functions | website | On | Settings role, Developer role | Includes the Activepieces service credential when invoking its flow webhook. |
| Result Processor | Settings › AI › Functions | website | None | Settings role, Developer role | Selects an optional processor for returned function output in supported execution paths. |
| Mode | Settings › AI › Functions › Result Processor | website | Citation / Guardrails Only | Settings role, Developer role | Chooses whether result processing adds citation or guardrail information or fully replaces the reused result. |

### Fields

| Field | Where | Required | What it is for |
|---|---|---|---|
| URL | Settings › AI › Functions | No | Specifies the destination for an API Call function. |
| Headers | Settings › AI › Functions | No | Supplies the header keys and values sent with API Call requests. |
| Custom Script | Settings › AI › Functions | No | Selects the configured script for a Custom Script function. |
| Tool Connection | Settings › AI › Functions | Yes | Selects the connection used by an MCP Tool function. |
| MCP Tool | Settings › AI › Functions | Yes | Selects the operation on the chosen MCP connection. |
| Activepieces Service | Settings › AI › Functions | Yes | Selects the automation service for an Activepieces Flow function. |
| Flow | Settings › AI › Functions | Yes | Selects the automation to invoke on that service. |
| Static Payload | Settings › AI › Functions | No | Defines additional key-value pairs sent on every Activepieces call without exposing them as AI parameters. |

### Permissions

| Permission | Lets you |
|---|---|
| Settings | Configure functions and result processors when AI is allowed under Settings Permissions. |
| AI | Allows AI configuration within Settings Permissions. |
| Developer | Configure functions and result processors. |

## Limits and good to know

- Calling a function can perform the external operation immediately. Its effect depends on the configured API, script or flow.
- An API success response does not independently prove that the business task succeeded. The returned content must describe that outcome.
- MCP and Activepieces operations need a valid service connection and selected operation.
- An agent's general run time is not an exact per-request timeout for every external service.
- Result processing changes how output is reused; it does not undo an action already performed by the external service.

## Depends on and works with

### This feature uses

- **Requires** [AI functions and required inputs](AI-016.md): Each external operation is a configured and assigned function.
- **Configured in** [Roles and permissions](ADM-008.md): Roles and AI permissions control function configuration.
- **Configured in** [AI feature settings and change history](AI-001.md): Feature instructions and function assignments determine available external actions.
- **Configured in** [AI run limits](AI-014.md): External operations consume the owning run's function allowance.
- **Configured in** [Shared AI service connections](AIP-013.md): MCP and Activepieces functions require their corresponding configured service connection.
- **Configured in** [MCP tool connections for AI](AIP-017.md): The MCP function selects the remote tool and its advertised inputs.
- **Configured in** [MCP service authentication](AIP-018.md): MCP connection authentication and outbound controls apply to MCP requests.
- **Configured in** [Integration script selection for automated actions](EXT-016.md): Script catalogue configuration supplies available custom scripts.
- **Works better with** [Reusable AI skills and instructions](AI-020.md): An active skill can add its selected external functions.
- **Works better with** [AI result processor templates](AI-040.md): Result processors can transform output or derive citation and guardrail information.
- **Works better with** [Custom scripts managed by Powerfront](EXT-015.md): Custom Script functions need a configured script implementation.

### Used by

- **Configures** [Integration script selection for automated actions](EXT-016.md): AI Functions selects the custom script used by a script-backed tool.
- **Configures** [Custom integrations](EXT-017.md): AI Functions selects the script and describes the arguments for a script-backed integration tool.
- **Enhances** [AI functions and required inputs](AI-016.md): External-action functions call APIs, scripts and connected automations.
- **Enhances** [Shared AI service connections](AIP-013.md): Activepieces connections expose automation flows for AI functions.

## FAQ and troubleshooting

### Why is the MCP Tool or Flow list empty?

Select the connection or service first. Ask Powerfront to check the connection and the operations it makes available if the list remains empty.

### Why does my API receive no JSON body?

Check the API Call **Type**. **Query String** sends a GET request; select **JSON** for a POST request with a JSON body.

### Why did a constant automation value change?

Generated arguments override **Static Payload** entries with the same name. Use distinct names when a value must remain fixed in the configured payload.

### Why did Custom Script return an error?

Check **Custom Script** is selected and ask Powerfront to review its implementation and returned result. Also confirm the agent supplied the expected arguments.
