Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 3.33 KB

README.md

File metadata and controls

39 lines (28 loc) · 3.33 KB

Actions

In Mechanic, an action is an instruction for performing work that has an effect. Actions are generated by tasks, in response to events. Each action has a type, specifying the class of operation to be performed, and options, providing specifics about what that operation will do.

Actions are defined by tasks using action objects, which are simple JSON objects specifying an action's type and options. Action objects can be constructed using the action tag.

{% hint style="info" %} In Mechanic, actions are performed after their originating task run concludes. Actions are not performed inline during the task's Liquid rendering.

To inspect and respond to the results of an HTTP action, add a task subscription to mechanic/actions/perform, allowing the action to re-invoke the task with the action result data.

Learn more: Responding to action results {% endhint %}

Action types

An action type determines the class of operation to be performed. While actions may vary greatly, there are only a few action types.

Action Purpose
Cache Performing operations on the store's Mechanic cache
Echo Debugging; displays the options that it is provided, with no side-effects
Email Sending transactional email
Event Generating custom user events
Files Generating files of various types, storing them at a temporary Mechanic-provided URL
FTP Performing FTP file uploads and downloads
HTTP Performing HTTP requests

Integrations

Mechanic maintains a set of integration actions, offering first-class support for several external services.

Action Integrated service Purpose
Google Drive Google Drive Upload files to Google Drive
Google Sheets Google Sheets Create, Update, Export Google Sheets
Flow Shopify Flow Sending customer, order, product, and general triggers to Shopify Flow
Shopify Shopify Admin API Sending requests to the Shopify Admin API, supporting both REST and GraphQL
Report Toaster Report Toaster Requesting reports from Report Toaster, or updating data within Report Toaster