sked artifacts automation

Manage the retrieval and deployment of automations.

Overview

Manage the retrieval and deployment of automations: a trigger plus a workflow of steps that runs when the trigger fires. Deploying automations as artifacts lets you keep them in source control and ship them in packages alongside the objects, configuration variables, and custom agents they depend on.

$ sked artifact automation <command>

Automations are available on the Skedulo Pulse Platform only, and the automations beta must be enabled for your team. See Learn about the automations beta.

If the automation commands are missing from your CLI, run sked artifacts update-descriptors to refresh the list of artifact types. If they are still missing, contact Skedulo support.

State file

The easiest way to produce a state file is to build the automation in the automation builder, then retrieve it with get. The file holds the trigger and the workflow definition:

{
  "metadata": {
    "type": "Automation"
  },
  "name": "sick-leave-find-cover",
  "description": "Raise a Tempo task when sick leave is recorded.",
  "status": "active",
  "trigger": {
    "type": "recordModified",
    "config": {
      "objectType": "Availabilities",
      "operations": ["Insert"],
      "filter": "current.IsAvailable == false AND current.Type == 'Sick'"
    }
  },
  "workflow": {
    "description": "Create a Tempo task for the leave.",
    "definition": {
      "StartAt": "CreateTask",
      "States": {
        "CreateTask": {
          "Type": "Task",
          "Resource": "action:create-tempo-task",
          "Arguments": {
            "title": "Sick leave recorded: find cover",
            "description": "{% 'A resource has recorded sick leave from ' & $trigger.current.Start & ' to ' & $trigger.current.Finish & '. Find cover for their jobs in that window.' %}"
          },
          "End": true
        }
      }
    }
  }
}
Field Description
name The automation’s name. Identifies it in get, delete, and upsert.
status active or inactive. An automation deployed without a status is activated.
trigger.type recordModified, event, recordTimeOffset, or scheduled. The shape of trigger.config depends on the type; see Triggers.
workflow.definition The steps, as an Amazon States Language state machine. Each Task state names an action as action:<action-name> and passes its arguments in Arguments, with JSONata expressions in {% %}. See Actions.

Commands

Command Description
Create Create an automation from a state file [deprecated, use upsert instead]
Delete Delete an automation
Get Get the state file for an automation
List List the existing automations
Update Update an automation from a state file [deprecated, use upsert instead]
Upsert Create or Update an automation from a state file

Create

Description

Create an automation from a state file [deprecated, use upsert instead]

Usage

  $ sked artifacts automation create -f <value> [--json] [-a <value>] [-w <value>] [--name <value>]

Flags

Flag Description Required
-f, --filename= The state file. Yes
-a, --alias=<value> The alias to use to authenticate. No
-w, --wait=<value> [default: 900] Number of seconds to wait for the command to complete and display results to the terminal window. No
--name=<value> The name of the automation. No

Global flags

Flag Description Required
--json Format output as json. No

Delete

Description

Delete an automation

Usage

  $ sked artifacts automation delete --name <value> [--json] [-a <value>] [-w <value>]

Flags

Flag Description Required
--name=<value> The name of the automation. Yes
-a, --alias=<value> The alias to use to authenticate. No
-w, --wait=<value> [default: 900] Number of seconds to wait for the command to complete and display results to the terminal window. No

Global flags

Flag Description Required
--json Format output as json. No

Get

Description

Get the state file for an automation.

Usage

  $ sked artifacts automation get --name <value> [--json] [-o <value>] [-a <value>]

Flags

Flag Description Required
--name The name of the automation. Yes
-a, --alias The alias to use to authenticate. No
-o, --outputdir The output directory. No

Global flags

Flag Description Required
--json Format output as json. No

List

Description

List the existing automations, with each one’s status, trigger type, and trigger object type.

Usage

  $ sked artifacts automation list [--json] [-a <value>]

Flags

Flag Description Required
-a, --alias=<value> The alias to use to authenticate. No

Global flags

Flag Description Required
--json Format output as json. No

Update

Description

Update an automation from a state file [deprecated, use upsert instead].

Usage

  $ sked artifacts automation update -f <value> [--json] [-a <value>] [-w <value>] [--name <value>]

Flags

Flag Description Required
-f, --filename=<value> The state file. Yes
-a, --alias=<value> The alias to use to authenticate. No
-w, --wait=<value> [default: 900] Number of seconds to wait for the command to complete and display results to the terminal window. No
--name=<value> The name of the automation. No

Global flags

Flag Description Required
--json Format output as json. No

Upsert

Description

Create or Update an automation from a state file. A deploy that omits status leaves an existing automation’s status unchanged, so redeploying does not reactivate one that was switched off in the web app.

Usage

  $ sked artifacts automation upsert -f <value> [--json] [-a <value>] [-w <value>] [--name <value>]

Flags

Flag Description Required
-f, --filename=<value> The state file. Yes
-a, --alias=<value> The alias to use to authenticate. No
-w, --wait=<value> [default: 900] Number of seconds to wait for the command to complete and display results to the terminal window. No
--name=<value> The name of the automation. No

Global flags

Flag Description Required
--json Format output as json. No

See also