Gorgias logo
Gorgias logo

All articles

Create Actions: use advanced options to build custom Actions for AI AgentUpdated 21 days ago

Note: to use this feature, you should have some familiarity with making HTTP requests to communicate with other applications. Otherwise, it is recommended that you ask a developer for help. 


You can use a visual workflow builder to create custom Actions for AI Agent that align with your brand’s unique business needs and use cases.

When you create an Action for AI Agent, select Advanced options to open a visual workflow builder. Brands that have the technical knowledge can use the visual editor to connect AI Agent with 3rd-party apps (using HTTP requests), and use conditional logic and variables to create different resolutions paths for an Action.

What you’ll need to get started

  • You must have familiarity with making HTTP requests to use Advanced options
  • You must have an active Automate subscription
  • You must have Lead or Admin permissions to create Actions
  • You must have AI Agent enabled on Email (currently Agent cannot perform Actions on Chat).

Enable the advanced Action editor

Whenever you create a new Action, you can choose to use the advanced editor. You can also convert an existing Action to use the advanced editor.

Keep in mind — if you enable the advanced editor (for a new or existing Action), you cannot return to using the basic editor to make changes to the Action.

  1. From the main menu, go to Automate
  2. Select your store from the sidebar, then click on AI Agent
  3. In the Actions tab, select Create Custom Action
  4. Enter a name and description, then set conditions for AI Agent to use the Action

  5. To use the advanced editor, select Advanced options
  6. Select Convert to Advanced View to confirm
  7. Select Edit to open the canvas for the advanced editor

Gorgias interface displaying the ‘AI Agent’ section under the ‘Actions’ tab. The configuration screen shows options for setting up an action. The ‘Action steps’ section includes an a button for ‘Advanced options’. The 'Advanced options' button is highlighted.

Using the advanced editor to build an Action

Once you enable the advanced editor, you can use the visual workflow builder to create a custom Action for AI Agent.

Collect information from shoppers (optional)

AI Agent can collect information from shoppers before performing an Action. The information that you collect can be used as variables to create different resolution paths for your shoppers.

For example, you may want to create an Action to provide shoppers with a refund when there’s an issue with their order. However, sometimes you may also reship the order based on the shopper’s contact reason.

At the beginning of your Action’s flow, use Collect information to tell AI Agent what information to gather from the shopper. Before the Action is performed, AI Agent will naturally and conversationally ask the shopper for these details.

  1. Select Collection information at the beginning of the Action’s workflow
  2. Select + Add Variable
  3. Choose a data type, then enter a Variable name and description
    • Using the example above, your variable name might be “replacement reason”. In the description, tell AI Agent: “categorize the replacement reason into one of the following categories: damaged, exception, lost in transit”
    • AI Agent can interpret customer responses to sort the replacement reason as either damaged, exception, or lost in transit
  4. Any information AI Agent collects can then be used as variables in subsequent Action steps, including HTTP requests and Conditions.

Gorgias interface displaying the configuration of a ‘Cancel an order’ action. On the left, the workflow diagram shows a ‘Collect information’ step, which is highlighted, followed by a ‘START’ node and an ‘END’ node. On the right, the ‘Collect information’ panel allows defining variables. A variable is being collected with the data type ‘String,’ variable name ‘Replacement reason,’ and description ‘categorize the replacement reason.’ A button labeled ‘+ Add Variable’ is visible.

Here are descriptions for each of the data types you can collect as variables:

Data typeDefinitionExample
StringAnything text contains letters or a combination of letters and numbersAn address, a cancellation reasons
BooleanTrue/false or yes/no questionsAnswers questions like:

  • “Is the product opened?”
  • “agrees to receive marketing”
  • “agrees to address change
NumberAny input that contains only numbersAsk about item quantity
DateA date in any formatAsking for a new delivery date

Adding steps to your Action

On the visual canvas, you can add one or more steps to your Action.

Each step connects to a different app where AI Agent needs to perform a task to complete your Action. You can select from apps that Gorgias already has an existing integration with, or use a custom HTTP request to connect with another 3rd-party app.

  • Use the + button to add a new step
  • Select an app that AI Agent needs to complete the Action
  • When you select an app, an alert ⚠️ appears beside steps that require additional set up from you

    • If an app requires you to authenticate → select the step to add your API key.

    • If an app requires additional values → select the step, then add the mandatory information

      • For example, if you add a step to send a Shopify discount code, you will need to select the discount amount, when the discount expires, and so on.
  • If you need to connect to an app that is not listed, select HTTP request

Gorgias interface displaying the workflow editor for a ‘Cancel an order’ action. The diagram includes a ‘Collect information’ step, followed by a ‘START’ node. A dotted arrow points to a ‘+’ button, indicating where a new step can be added.

Making custom HTTP requests

An HTTP request allows you to connect AI Agent to apps that Gorgias has not already built an integration with.

To successfully set up an HTTP request, we recommend that you review the developer documentation for the app you want to communicate with.

  • On the visual canvas, select the + button to add a step
  • Select HTTP request
  • Enter the details of the request:

    • Give the step with your HTTP request a name
    • Enter the endpoint URL for the application where you want to make the request
    • Choose your HTTP method (GET, POST, PUT, DELETE, PATCH)
    • Set up your request’s headers using key-value pairs
  • Use {+} to add variables to the URL, header or body of your request. You can use variables from:

  • Select Test Request to try out your request and fix any errors
  • Under Output variables you can select data from the HTTP response to create variables that can be used in subsequent Action steps, including conditions and other HTTP requests.

    • Select + Add Variable, then enter a variable name for the data you want to use
    • Use JSONpath notation to select the data you want from the HTTP response (for example $.address.city)
  • Optionally, under Results explanation for AI Agent you can add context about the data you want to use as a variable

    • For example, data from the HTTP response called $.message may actually refer to an order status. You can add a description for AI Agent so that its use of the variable is more accurate.
    • Select + Add Output, then enter a description of the variable for AI Agent

Gorgias interface displaying the workflow editor for a ‘Cancel an order’ action. The workflow diagram includes a highlighted ‘HTTP request’ step labeled ‘Get order information.’ On the right, the configuration panel for the HTTP request is visible. Fields include ‘Request name’ set to ‘Get order information,’ a ‘URL’ and ‘HTTP method’ set to ‘GET.’ The ‘Headers’ section includes an ‘authorization’ header with a bearer token as its value. The ‘Output variables’ section maps the ‘order status’ variable to a JSONPath expression ‘$.order.status.message,’ with the data type set to ‘String.’

Conditional steps and variables

Conditional steps add branches to your Action’s workflow. You can use conditions to give shoppers a different resolution path based on a set of variables.

Variables you can use include:

For example, you may want to create an Action so that AI Agent can process returns, but you only accept returns in the United States. You can use a conditional step that checks for the variable Shipping address country from the shopper's order before AI Agent sends a link to your return portal.

  • On the visual canvas select the + button to add a step, then select Conditions
  • Configure each branch in your conditional step:

    • Give each branch a name
    • Choose what level of conditions must be met for AI Agent to proceed with the branch: All conditions are met or At least 1 condition met
    • Open the Add Condition dropdown menu to select one or more variables as your conditions
  • Select + Add Branch to add another branch

Test your Action

When you finish setting up your Action, you can test how it works in the AI Agent test environment. Select Create and Test to go to the test environment directly from the Action editor.

The test environment is a controlled space where you can simulate real interactions with shoppers — including asking questions about orders or imitating Actions. When used in the test environment, Actions do not make any changes in your connected apps.

Troubleshooting Action errors

If AI Agent encounters an error with your set up, it may be unable to fully complete all the steps in your Action.

In these cases, AI Agent adds a note in the ticket conversation to indicate that it failed to perform one or more Action steps and handed over the ticket to your team. You can use the link in the note to go to the Action’s event log. Look for entries with an error status to investigate.

Was this article helpful?
Yes
No