How to get started with the automations module in Wink Reports
Automations allow you to shuffle data between connectors, or act upon and execute certain actions based on the information contained in reports. For a visual overview, see the video What Are Automations?
There are three main parts:
- Trigger - what causes the automation to run. Could be a schedule, or new data arriving from a connector
- Settings Report - a report attached to the automation which is the brain of the operations. It can lookup data, apply filtering, use formulas to drive complex decisions.
- Actions - A list of things to do for each row in the settings report, such as send an email. The options for an action can be static (e.g. a fixed email subject) or linked to a column in the settings report (e.g. recipient email address)
Getting Started
Create a new automation from the automations module. You'll be asked for a title, then taken straight to the designer.
A settings report will be automatically created and linked to the automation. This link can't be changed, and each automation has exactly one settings report linked.
Triggers
For most automations, a Schedule Trigger is ideal. It runs at an interval you choose, and is easy to reason about and control. Pair this with a sensible filter formula in the settings report and row behaviour to prevent duplicates.
A URL Trigger can be useful for testing the automation. It generates a special URL that you can visit and press a button to trigger the automation at any time. You can also use the special URL to link with other tools.
You can create as many triggers as you need. If your settings report has dynamic filters (which is unusual!), you can configure the settings report filter values for each trigger. This lets you pick different report behaviour depending on which trigger starts the automation.
Settings Report
Most commonly you want an automation to act when a job, task, form, invoice, customer etc. is created or when a certain value (e.g. status) is changed. The settings report is where you lookup this information in order to power the actions.
Typically, a settings report should not have filters enabled (such as date range). You should use a filter formula to pick which rows should appear.
You should only enable settings report filters if you plan to pass different values from multiple triggers.
The settings report must execute in less than 45 seconds, or the automation won't run. Complex merges or filter settings which produce many rows might not be suitable for automations.
Row Behaviour
If using the recommended method of a schedule trigger and settings report with a fixed filter formula, you will likely get repeated rows feeding into the automation for each scheduled run.
The row behaviour section lets you customise how rows are handled before being passed to the actions.
- For every row - run the actions for every row in the settings report. Don't prevent duplicates
- For every unique row - pick some "key columns" used to identify a row (e.g. job number, invoice number), and the row will be discarded if these values have been seen before
- When certain values change - pick some "key columns" and "value columns". If the row identified by "key columns" has been seen before and the "value columns" haven't changed, discard the row. e.g. picking Job Id and Status columns would trigger the automation whenever the status of each job changes.
- When certain values change (except new) - as above, but discard a row if never seen before
- Always (ignore report) - don't execute the settings report at all. Run the actions once. Action options can't be linked to column values, only static options can be used.
- If the report has any rows - Run the actions once, but only if the settings report has at least one row. Actions options can't be linked to column values, only static options can be used.
Actions
Provide a list of actions to be taken for each row in the settings report (depending on the row behaviour). Each action provides a number of options which can have a fixed static value, or be linked to a column from the settings report.
Every action has an Enabled option which lets you use a report formula to choose if certain actions will run.
Each action has a credit cost associated. Most actions cost 1 credit, but some are free and a few cost more. These credits are deducted from your subscription allocation every time they are executed.
Some actions have output columns which can provide values to latter actions (e.g. newly created Job #).
Some notable utility actions:
- Wink - Write a message to the automation logs. Lets you write a custom message to the automation log.
- Wink - Apply Template. Use an advanced template language to construct HTML emails, JSON payloads, and construct custom messages to pass to latter actions.
Safety Checks
Before taking your automation live, you should do a few checks to make sure the actions will do what you expect.
Dry Run
Every trigger has a "play" button which performs a dry run. This executes the settings report with the given filter values, and gives a preview of the rows returned and how they are mapped into the actions. No actions will actually execute.
Use this to get an idea of what will happen when running for real.
Max Rows Safety Valve
If you expect to only ever have a handful of rows from the settings report, put in a number for the Max Rows Safety Valve. If the rows from the settings report exceeds this value, the automation will refuse to run.
This is useful to prevent accidents where filter changes in the settings report or formula logic errors might accidentally cause an undesirably large number of actions to execute.
Publish and Activate
At any time you can save a draft of the automation. When ready to go live, use the Publish button. A dry run of the first trigger will happen and you'll be shown a summary of what actions will happen on the next run.
At any time you can pause and resume the automation.
Note: pausing only affects the activation of triggers. It won't stop an already running automation.
Transformers
A select few actions accept multi-row inputs. For example: Cin7 Core - Create Sale Invoice accepts multi-row inputs for the line item fields.
To construct a multi-row input, use the settings report option "Add Transformer" to group similar rows together.