> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phonely.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Actions

> Learn how to build, publish and update custom actions in Phonely

Custom actions allow you to package a series of connected blocks into a single reusable block.\
Once created, you can reuse this actions across multiple call flows, share it with your organization, or even publish it to the marketplace.

Think of a custom action as a mini reusable workflow inside your larger flow. It behaves like a single block but contains its own inner logic, inputs, and outputs.

**When to Use a Custom Action**

Custom Actions are ideal when you need to:

* Combine multiple blocks into a single, reusable action.
* Reuse the same multi-step process across multiple agents or flows.
* Standardize logic such as appointment booking, identity verification, or eligibility checks.
* Update logic in one place and automatically apply changes everywhere it’s used.

## Building a Custom Action (Appointment Example)

Let’s build an appointment custom action that collects a caller’s preferred time, checks availability, and books the appointment. Once created, this custom action can be reused across any workflow where callers need to schedule an appointment, without rebuilding the logic from scratch.

<Steps>
  <Step title="Create a new workflow, or open an existing one" />

  <Step title="Click the ＋ button under any existing block" />

  <Step title="Select Build a Custom Action. A purple editor window opens, this is your custom action workspace" />
</Steps>

Inside the purple area, click the **＋** button below the Start node to begin adding blocks.

<img src="https://mintcdn.com/phonely/J1SHiOdv0Kh5Te7B/assets/add-actions-to-blocks.png?fit=max&auto=format&n=J1SHiOdv0Kh5Te7B&q=85&s=497f854949f7fd57d901ca757efb4caf" alt="Add Actions To Blocks" title="Add Actions To Blocks" style={{ width:"82%" }} width="3100" height="2524" data-path="assets/add-actions-to-blocks.png" />

### Collect Appointment Preferences

Start by gathering the caller’s preferred date or time. Add a **Talk** or **Collect** block to ask something like:

> “What day would you like to schedule your consultation?”

Store the response in a variable such as `booking_date`.

<img src="https://mintcdn.com/phonely/jyis0VoDpcYYC93-/assets/kcollection-details-custom-action.png?fit=max&auto=format&n=jyis0VoDpcYYC93-&q=85&s=6c6e9cc03b18a9f1474e5b27a6e7f160" alt="Kcollection Details Custom Action" width="3644" height="2280" data-path="assets/kcollection-details-custom-action.png" />

### Check Availability (Google Calendar)

Next, check whether that time is available.

1. Click **＋** and select **Google Calendar**
2. Choose **Check Availability**

Configure the block:

* Select the calendar
* Set the search window and slot duration
* Limit results to business hours
* Choose how many slots to return

This block returns available time slots that you can present to the caller.

<img src="https://mintcdn.com/phonely/jyis0VoDpcYYC93-/assets/kget-avaialability-custom-action.png?fit=max&auto=format&n=jyis0VoDpcYYC93-&q=85&s=ca9b6b7f9c416d16af19ab08c9c2d808" alt="Kget Avaialability Custom Action" title="Kget Avaialability Custom Action" style={{ width:"90%" }} width="3356" height="2316" data-path="assets/kget-avaialability-custom-action.png" />

### Let the Caller Choose a Slot

Add another **Talk** or **Collect** block to present the options: “I have availability at 10 AM or 2 PM. Which works for you?”

<img src="https://mintcdn.com/phonely/9JOXTMOXGLcmbe8X/images/present-available-slots-custom-action.png?fit=max&auto=format&n=9JOXTMOXGLcmbe8X&q=85&s=caeebdc0acd009e2be1a3f51f2e47cf5" alt="Present Available Slots Custom Action" width="3460" height="1504" data-path="images/present-available-slots-custom-action.png" />

### Create the Appointment

Once the caller selects a time:

1. Click **＋**
2. Select **Google Calendar**
3. Choose **Create Appointment**

Configure:

* Calendar ID
* Start and end time using `selected_slot`
* Attendee email (from a collected variable)
* Title and optional description.

If successful, Google Calendar automatically sends the invite.

<img src="https://mintcdn.com/phonely/jyis0VoDpcYYC93-/assets/kmake-appointment-custom-action.png?fit=max&auto=format&n=jyis0VoDpcYYC93-&q=85&s=956614aeff1283702de6ee1e848bd888" alt="Kmake Appointment Custom Action" title="Kmake Appointment Custom Action" style={{ width:"95%" }} width="3400" height="2240" data-path="assets/kmake-appointment-custom-action.png" />

### Connect Output Paths

Output nodes define how your custom action communicates results back to the main flow.\
They act as exit points - determining what happens once your action finishes, whether it succeeds, fails, or the caller ends the process.

<img src="https://mintcdn.com/phonely/_jdAgjaqfJdK0vDj/assets/managing-output-nodes.gif?s=bc287b72604157f13e069691c826ba44" alt="Managing Output Nodes Gi" style={{ width:"95%" }} width="1196" height="716" data-path="assets/managing-output-nodes.gif" />

Each output path represents a possible outcome of your action. For example:

* **Success:** The action completed successfully. i.e The appointment was booked and confirmed.
* **Fail:** Something went wrong during the process. i.e The booking API request failed or returned an error.
* **Not Interested:** The caller declined to proceed. i.e The client decided not to book or continue with the call.

These output paths let you control what the AI should do next, ensuring that every scenario is handled gracefully.

**Adding Output Nodes**

1. Click any empty area inside the purple custom action box (the group area).
2. The **Global Settings** panel will slide in from the right side.
3. Under **Output Paths**, you’ll see existing nodes (e.g., *Success*, *Fail*, *Not Interested*).
4. To create a new one, click **➕ Add Output Path** button, then enter the name - for example, Escalate or \_Reschedule. \_
5. Click **Done** to save your changes.

Once saved, each output path will appear as a small circle at the bottom of the purple custom action box, ready to connect to the next step in your flow.

### Connect to End Call and Post-Call Actions

Once your appointment logic is complete and all outcome paths are defined, you need to connect your custom action to the End Call block and any post-call actions that should run after the conversation finishes.

**Add the End Call Block**

At the bottom of your flow, click the **＋ button** and select **End Call**. This block finalizes the interaction once all other actions have run.

**Link Each Output Path to Its Next Step**

Make sure every outcome path from your Custom Action connects to the appropriate block:

| **Output Path**    | **Typical Connection**                 | **Example Action**                                                        |
| :----------------- | :------------------------------------- | :------------------------------------------------------------------------ |
| **Success**        | End Call> Send SMS or Send Email       | “Your consultation is confirmed for Thursday at 2 PM.”                    |
| **Error**          | > Escalate to Support or Transfer Call | Route the caller to a live receptionist if booking fails.                 |
| **Not Interested** | > End Call                             | Politely close the call: “Alright, no problem — thank you for your time.” |

These connections ensure that each scenario is gracefully handled without leaving the caller in an unfinished state.

**Add  Post-Call Actions**

If you want to follow up or log the appointment automatically, add post-call blocks:

* **Send Email:** Send an internal summary to your legal assistant or client.
* **Send SMS:** Send a text reminder or confirmation link.
* **API Request:** Log the appointment into your CRM or case-management system.
* **Code Block:** Run custom logic - for example, update case status or trigger automation in another tool.

**Link to Another Custom Action**

You can also chain this custom action to other custom actions, creating seamless workflows across multiple integrations.

<img src="https://mintcdn.com/phonely/_jdAgjaqfJdK0vDj/assets/post-call-options-for-custom-actions.gif?s=38e5bc94293dedef097eb06fb6bbbc13" alt="Post Call Options For Custom Actions Gi" width="1196" height="716" data-path="assets/post-call-options-for-custom-actions.gif" />

Once all nodes are connected and fields are configured, your custom action for appointment booking is ready.

### Publish or Save

Once your custom action is complete and tested, the next step is to **publish** or **save it as a draft**, either for private testing, internal team use, or public sharing. Publishing determines who can access, reuse, and configure the action in other call flows.

<img src="https://mintcdn.com/phonely/_jdAgjaqfJdK0vDj/assets/saving-and-publishing-a-custom-action.gif?s=bf8a0b1fc191bf4f4657a9f887df9dc9" alt="Saving And Publishing A Custom Action Gi" width="1184" height="720" data-path="assets/saving-and-publishing-a-custom-action.gif" />

**Accessing the Publish Options**

To begin publishing:

1. Click the **⋯ (three vertical dots)** at the **top-right corner** of the purple custom action area.
2. From the dropdown menu, select one of the following options:

| **Option**                  | **Purpose**                                                                                                                                     |
| :-------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------- |
| **Save as Draft**           | Keeps the custom action private to your current flow. Ideal for ongoing testing or early prototypes.                                            |
| **Publish to Organization** | Shares the custom action with your team members. Everyone in your organization can add it to their own call flows and update to newer versions. |
| **Publish to Marketplace**  | Submits the action for public review and distribution, making it available to all users on Phonely.                                             |

### Configure Customizable Fields

After selecting a publish option, Phonely will prompt you to configure fields.\
This step defines which variables other users can edit when they use your custom action in their own flows.

1. The **Configure Fields** window opens automatically. Here you’ll see all available nodes, such as headers and query parameters, listed on the left panel.
2. Check the boxes next to the parameters that you want users to customize for example:
3. On the right side, Phonely shows editable text fields labeled: “User will enter value here.” This indicates that the selected parameter will be visible and configurable by others.
4. Click **Next** to continue once you’ve chosen all relevant fields.

<img src="https://mintcdn.com/phonely/92-YWjeCySzQC5rN/assets/fields-to-configure-when-adding-custom-action.png?fit=max&auto=format&n=92-YWjeCySzQC5rN&q=85&s=2e529353e3a8f5c5bb56cfda5c8b3168" alt="Fields To Configure When Adding Custom Action" title="Fields To Configure When Adding Custom Action" style={{ width:"91%" }} width="3264" height="2140" data-path="assets/fields-to-configure-when-adding-custom-action.png" />

### Finalize Details and Submit

After configuring fields, you’ll move to the finalize custom action window.    \
This is where you define how your integration will appear to others.

1. **Integration Name:** Choose an existing integration or create a new one.
2. **Description:** Provide a clear summary of what your custom action does.
3. **Icon:** Select an icon to represent your custom action.
4. **Action Name:** Enter a short, clear title for the action.
5. Click **Submit** to finalize and publish.

<img src="https://mintcdn.com/phonely/92-YWjeCySzQC5rN/assets/finalize-custom-action.png?fit=max&auto=format&n=92-YWjeCySzQC5rN&q=85&s=32d408dc22e811d36b9379123ee5c7fc" alt="Finalize Custom Action" title="Finalize Custom Action" style={{ width:"53%" }} width="1644" height="1656" data-path="assets/finalize-custom-action.png" />

### Your Custom Action is now ready to use

After submission, you’ll receive a confirmation message indicating that your custom action has been successfully created or updated.

Depending on your chosen option:

* **Draft:** Appears only within your current project.
* **Organization:** Appears in your team’s shared action library.
* **Marketplace:** Submitted for review by Phonely’s moderation team before public listing.

You can always return to the **⋯** menu to Update the action,Edit metadata (name, description) or re-publish.

You and your team can now find the published action under the custom actions sections under your chosen integration name ready to drag, configure, and connect into their own call flows.

<img src="https://mintcdn.com/phonely/_jdAgjaqfJdK0vDj/assets/how-to-use-published-custom-actions.gif?s=fc1ab21537bcb2fee8c86d33ac19aee9" alt="How To Use Published Custom Actions Gi" width="1184" height="720" data-path="assets/how-to-use-published-custom-actions.gif" />
