Custom Actions

View as Markdown

Custom action named create_lead, configured as a POST request to a webhook endpoint with HubSpot authentication, alongside the Results panel showing setup inputs, an Initialize button, and a successful response body

Custom actions are HTTP requests your agent can run before or during a call. Use them when you need live data from an external API or when the agent must trigger a workflow outside Synthflow, such as creating CRM records, checking an order status, or sending structured data to another system.

Create and configure a custom action

Open Actions, create a Custom Action, then configure four parts:

  1. Request setup: select method, endpoint URL, headers, body, and authentication.
  2. Variables: define fields the model should extract or inject.
  3. Action details: set a clear name and description so the model knows when to call it.
  4. Result handling: write prompt logic that uses returned data in the next turn.

Use the request method that matches the API operation you want to run:

MethodWhat it doesCommon custom action use case
GETRetrieves existing data without creating or updating records.Look up a customer profile, order status, or availability data.
POSTCreates a new record or triggers an operation.Create a lead, submit a form, or start a workflow.
PUTReplaces an existing record with a full new payload.Overwrite a contact record with updated details.
PATCHPartially updates an existing record.Update one field, such as appointment status or phone number.
DELETERemoves an existing record.Delete a test record or cancel a resource in an external system.

Variables

Custom action variables configured in the action builder

Use variables to map conversation context into requests:

  • User-defined variables for values you want extracted during the call, such as full_name or order_id.
  • Default variables for call metadata, such as call_id, twilio_call_sid, to_phone_number, from_phone_number, and user_phone_number.
1{
2 "phoneNumber": "<user_phone_number>",
3 "fullName": "<full_name>",
4 "callId": "<call_id>"
5}

Authentication

Authentication type menu with Salesforce and Salesforce Sandbox options

Choose the authentication mode your endpoint expects in the Authentication Type menu. Available built-in connections include:

Match the action configuration to your provider’s required header format and environment.

Instructions

Custom action messages configuration

To configure what the agent says while an action runs, open Actions > your custom action > AI Instructions.

You can set:

  • Start message
  • Delay message
  • Failure message

If you disable Let the agent speak naturally, the agent will follow your configured messages more strictly.

Initialize

After you finish configuration, variables, authentication, and message setup, click Initialize in the action editor before using the action in production flows.

Initialization validates that your endpoint, authentication, and payload are configured correctly. Without this step, your action is not ready for reliable use.

Initialized custom action showing response body and output variables

Once initialization succeeds, the returned fields become action result variables that you can reference later in prompts or pass into other actions.

Inspect requests

Every time your custom action runs during a call, the request and response are recorded in API logs. Open the matching entry to inspect the request URL, headers, body, response payload, and timing details for that specific call.

Examples

Retrieve date and time

You can create a lightweight GET custom action to fetch current local time before a call starts, then use that result in prompts.

Use http://worldtimeapi.org/api/timezone/:area/:location[/:region] and replace placeholders with your timezone, for example America/Chicago. For the full timezone list, call http://worldtimeapi.org/api/timezone.

Run several custom actions

You can chain actions so one response feeds the next step.

For example, you can run one action to fetch a customer email from your CRM and a second action to use that email for booking or an update. Attach both actions to the same call flow stage (typically During Call) and describe execution order in your prompt logic so the model runs the first action before passing the returned fields to the second.

FAQ

Use a custom action when your agent needs live external data or must trigger a system outside Synthflow. Prompt-only logic is usually enough for static conversational behavior.

Yes. You can chain actions and pass outputs from one action into the next, as long as your prompt logic clearly defines order and mapping.

Yes. Connect both and select the matching authentication per action.

Yes. Each environment has its own Salesforce domain, so each action should use environment-specific endpoints.

Yes. You can configure a custom action to run before the conversation begins when you need context ready in advance, such as account details or time data.

Default variables include call metadata and phone context, such as call_id, twilio_call_sid, to_phone_number, from_phone_number, and user_phone_number.

Use clear, task-oriented names and descriptions that describe one outcome. Good naming helps the model pick the right action in the right context.

Set a failure message in the action’s Messages settings, and add prompt guidance for fallback behavior so the agent can continue the conversation gracefully. To diagnose the failure itself, open the call in API logs and inspect the request and response that the action made.

Use one action per business task whenever possible. Smaller, focused actions are easier to test, safer to maintain, and easier for the model to choose.