Skip to content

Ready actions in automation tools

An automation app puts your product inside the automation tools a Customer's team wires by hand, generated from the file and under your brand.

One connection, from sign-in to revoked

What the tool shows, and where it comes from

Each tool reads the app in its own format. Every format holds the same parts, each from one line of the file.

In the fileIn the tool
A Verb in actionsA ready action, its input fields typed from the Noun, the required ones marked
A list or search Verb in searchesA step that finds one record by a field, for the next step to use
A move in triggersAn instant trigger, with a sample record from the docs' example
A RelationshipA field filled from a list call, such as the record a link points to
An enum fieldA drop-down of its values
The OfferEach action's price beside its name, as the docs print it
A ProblemThe tool's error, with the cure link the Problem carries

The app is generated at every deploy, so a new field appears in the tool with the Version that adds it.

Signing in

auth: 'oauth' puts a connect button in the tool. It opens your product's sign-in on your Host.

The sign-in carries your brand, and the member consents to the Verbs the app offers.

Each connection is an app in the Customer's org. It gets a Key of its own, limited to those Verbs, which the member or an admin revokes from the portal.

With auth: 'key', the member pastes a Key instead, and the tool checks it with one free call before it saves the connection.

Instant triggers

A trigger holds a Watch while its workflow is on: the tool creates it when the workflow turns on, and deletes it after.

Each delivery is signed and retried for 3 days. It carries the Event's id, so the tool runs once per Event.

A hook unanswered for 3 days pauses its Watch, and the member hears of it in the tool and the portal.

A tool that cannot hold a hook reads the change feed instead, from the cursor of its last read, and misses nothing.

The tracker, in every tool

The sales tracker offers every Verb as an action, one search, and each win as an instant trigger.

definition.ts
17 lines
import { define } from 'apis.dev'

/** Deals for each Customer, ready in the automation tools its team already uses. */
export default define({
  name: 'pipeline', domain: 'pipeline.apis.dev',
  Company: { name: 'string', domain: 'url!#', deals: '<-Deal.company' },
  Deal: {
    title: 'string', amount: 'decimal(12,2)', company: '->Company.deals',
    stage: { open: [], qualify: 'opened', win: 'qualified', lose: ['opened', 'qualified'] },
  },
  offer: {
    Free: { month: 0, seats: 1, includes: { 'Deal.open': 25 } },
    Team: { month: 49, seats: 5, includes: { 'Deal.open': 1000 } },
    'Deal.open': 0.001,
  },
  automations: { actions: 'all', searches: ['Company.list'], triggers: ['Deal.win'], auth: 'oauth', list: true },
})

The tool reads one action and one trigger from the app like this.

The app · one action and one trigger
16 lines
{
  "app": "pipeline",
  "version": "4",
  "auth": { "type": "oauth2", "authorize": "https://pipeline.apis.dev/auth/authorize" },
  "actions": [
    { "key": "openDeal", "label": "Open a deal", "price": "0.001 USD a call",
      "fields": [
        { "key": "title", "type": "string", "required": true },
        { "key": "amount", "type": "number" },
        { "key": "company", "type": "string", "from": "listCompanies" }
      ] }
  ],
  "triggers": [
    { "key": "dealWon", "label": "Deal won", "event": "Deal.won", "hook": "/watches" }
  ]
}

Versions, money and the directories

What changesWhat a connection meets
A deploy that adds a field or a VerbThe app's next version, read by every connection at its next run
A deploy that removes or retypes oneA new major version beside the old, which keeps working for 12 months
An action past the Customer's plan or balanceA 402 that stops that run, with the Checkout link in the tool's error
A refused or failed callNo charge, as on every Interface
list: trueThe app is submitted to each tool's public directory under your brand, from Launch

Automation.publish sends the current version to every directory, and Automation.list shows each connection with its last delivery.