How to use Apple Automator to trigger an Axiom.ai automation
Automator is a macOS application that allows users to create custom workflows, tasks, and scripts to automate repetitive actions and streamline processes without needing extensive programming knowledge. This comes pre-installed on all macOS systems.
# Getting started
To get started, you will need the following from the Axiom.ai Chrome extension:
- API key - The API key is found on the dashboard.
- Automation name - Get the name of the automation you wish to trigger.
- Endpoint - The current endpoint is
https://lar.axiom.ai/api/v3/trigger.
# Trigger an Axiom.ai automation using Automator
To get started, create your Automator workflow as you normally would, when you're ready to trigger your automation, continue this guide.
Using the data from above, we will construct multiple variables called webhookURL, to store the URL of the Axiom.ai API, and jsonData to construct the payload that is to be sent to the automation. There are numerous modifications that will be needed:
<YOUR_KEY>- This should be replaced with your API key.<AUTOMATION_NAME>- This should be replaced with your automation name.data- The contents inside of thedatakey should be replaced with your own data, if you wish to send data to your automation. This should be an array of arrays, as is in the example.
When ready, add a "Run AppleScript" component to your workflow to add the following script into your workflow and trigger your automation:
on run
-- The endpoint from above
set webhookURL to "https://lar.axiom.ai/api/v3/trigger"
-- This is the payload that is being sent to the Axiom.ai API. All quotation marks inside the curly brackets will need to be escaped.
set jsonData to "{ \"key\": \"<YOUR_KEY>\", \"name\": \"<AUTOMATION_NAME>\", \"data\": [[\"Item 1\", \"Item 2\"]] }"
try
-- Send the POST request using 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: " & errMsg
end try
end run
# Testing your workflow
In order to test your workflow, click "Run", or run the script on its own. Any errors that are being produced within Automator will appear within the "Run Applescript" component of your workflow. Follow the instructions within the component for more information on how to proceed.
For more information on errors related to the Axiom.ai API, see Common Errors.
# Wrapping up
Automator provides a great method of being able to run your Axiom.ai automations. It offers the ability to access various pieces of information from the system itself, which can be beneficial when it comes to monitoring system configuration, such as memory. Your automations can easily be used as a middle-man to set up notifications for system monitoring, especially if the system is being used in server configuration.
Information accurate as of January 2025, changes to either platform may render these instructions non-functional.