Custom Actions

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:
- Request setup: select method, endpoint URL, headers, body, and authentication.
- Variables: define fields the model should extract or inject.
- Action details: set a clear name and description so the model knows when to call it.
- 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:
Variables

Use variables to map conversation context into requests:
- User-defined variables for values you want extracted during the call, such as
full_nameororder_id. - Default variables for call metadata, such as
call_id,twilio_call_sid,to_phone_number,from_phone_number, anduser_phone_number.
Authentication

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

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.

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
When should I use a custom action instead of prompt-only logic?
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.
Can I run multiple custom actions in one call?
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.
Can I use both Salesforce Production and Sandbox in one workspace?
Yes. Connect both and select the matching authentication per action.
Do I need different URLs for Salesforce Production and Sandbox?
Yes. Each environment has its own Salesforce domain, so each action should use environment-specific endpoints.
Can custom actions run before the call starts?
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.
Which variables are available by default in custom actions?
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.
How should I name custom actions so the model uses them correctly?
Use clear, task-oriented names and descriptions that describe one outcome. Good naming helps the model pick the right action in the right context.
What should I do if a custom action fails during a call?
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.
Should I keep one action per workflow or reuse one action for many tasks?
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.