Trigger an axiom.ai automation from Apple Automator


How to trigger an axiom.ai automation from Apple Automator: install the Chrome extension, click Build with Browser agent, tell the agent what you want, and follow its prompts. A working bot is built and tested in minutes.

Here is how the automation works. To trigger an axiom.ai automation from Apple Automator, add a Run AppleScript action to your Automator workflow that posts your API key, the automation's name and any data to https://lar.axiom.ai/api/v3/trigger. The automation starts with a Receive data from another app step, which hands the data to the steps after it.

Author
Alex Barlow
Published

Build the Automator trigger from a description


Describe it and click the button: the agent builds and tests the automation in your Chrome extension. The trigger needs your API key, from API keys, on a plan that includes the API, on pricing.

  1. Start when Apple Automator sends me data
  2. Take the rows it sends
  3. Add them to my Google Sheet
Click to launch the Chrome extension. Not installed? You can create an account and try it free.Opens the Chrome extension. Free account to try.

Note the automation's name exactly as it is saved: the trigger matches it character for character. Automator comes installed on every Mac; the script that goes into it is in the questions below.

Build the Automator trigger step by step


The steps the agent builds, as the Builder shows them: each step by its name, with the fields to set under it. Add them yourself in this order in the step-by-step builder, or open the agent's result there to adjust it.

  • 1.0 Receive data from another app
    • Test data: [["Item 1", "Item 2"]], rows to try it with before Automator sends any
  • 2.0 Write data to a Google Sheet
    • Spreadsheet: your sheet
    • DATA: [webhook-data]
    • Write options: Add to existing data

Common questions about triggering an automation from Apple Automator


How do I add the trigger script to the Automator workflow?

Paste the script below into a Run AppleScript action at the point in your workflow where the axiom.ai automation should run, and change three things in it:

  • Replace <YOUR_KEY> with your API key.
  • Replace <AUTOMATION_NAME> with the automation's name.
  • Replace the contents of data with your own data, as an array of arrays like the example. Leave data out if the automation needs none.
on run
    -- The axiom.ai trigger endpoint
    set webhookURL to "https://lar.axiom.ai/api/v3/trigger"

    -- The payload sent to the axiom.ai API. Every quotation mark inside the curly brackets is escaped.
    set jsonData to "{ \"key\": \"<YOUR_KEY>\", \"name\": \"<AUTOMATION_NAME>\", \"data\": [[\"Item 1\", \"Item 2\"]] }"

    try
        -- Send the POST request with cURL
        set response to do shell script "curl -X POST " & quoted form of webhookURL & " -H 'Content-Type: application/json' -d " & quoted form of jsonData
        return "Webhook successful: " & response
    on error errorMsg
        return "Webhook failed: " & errorMsg
    end try
end run

The script stores the endpoint in webhookURL and the payload in jsonData, then sends them with cURL and returns the API's reply.

How do I test the Automator workflow?

Click Run in Automator, or run the Run AppleScript action on its own, and read its result. Webhook successful: followed by the API's reply means the call reached axiom.ai; Webhook failed: followed by an error means it did not. Then check the Google Sheet for the rows you sent.

Why does the Run AppleScript action say the webhook failed?

The action shows the error after Webhook failed:; follow what it says. The two usual causes are an unescaped quotation mark inside jsonData, which breaks the payload, and a key or automation name that does not match. For errors the axiom.ai API returns, see common errors. When a run fails, hand it to the agent and it repairs the step.

What data can Apple Automator send to the automation?

An array of arrays, one inner array per row, in the payload's data key. The automation receives it as [webhook-data] from Receive data from another app, and any step after it can use it.

Why trigger axiom.ai from Apple Automator?

Automator can read information from the Mac itself, such as memory use, so an axiom.ai automation can act on it, for example to send a notification when a Mac used as a server needs attention.

Can I trigger an axiom.ai automation from Automator without code?

Almost. The axiom.ai side is built from the lines above with no code; the Automator side is the one script above, pasted in with your key and the automation's name filled in.

Can I trigger an axiom.ai automation from other apps the same way?

Yes. The same request works from any app that can send a POST: see trigger an automation from Power Automate, trigger an automation from Google Apps Script and trigger a web scraper from a webhook.

Where do I get help?

Get in touch with support, or ask in the axiom.ai community.

Related guides