Automation Workflow
Requires access scope. Also: The app must have write access to automations and act on behalf of a user.
A version of an automation that runs tasks when a trigger event occurs. An automation can have a saved draft
while another version is active. All versions share the same ID, name, and tags; configuration, note,
and describe the selected version.
Use to create a draft and to edit it.
Compare with version to check whether this version is running.
Anchor to FieldsFields
- activeVersion (String)
- adminApiVersion (String)
- configuration (JSON!)
- createdAt (DateTime!)
- id (ID!)
- name (String!)
- note (String)
- tags ([String!]!)
- updatedAt (DateTime!)
- validationErrors ([AutomationWorkflowValidationError!]!)
- version (String!)
- versionState (AutomationWorkflowVersionState!)
- Anchor to activeVersionactive•String
Version The version of the automation that's currently active, or null when the automation is inactive. This version is active only when it matches
version.- Anchor to adminApiVersionadmin•String
Api Version The Admin API version used by this automation version.
- Anchor to configurationconfiguration•JSON!non-null
The steps, links, and custom fields (
) for this version, encoded as JSON. Includes__metadata.versionfor the configuration format. Name, tags, and note are returned as separate fields. Use this value as the replacement configuration in. See the workflow configuration JSON Schema.- Anchor to createdAtcreated•Date
At Time! non-null The date and time when the automation was created.
- •ID!non-null
A globally-unique ID.
- Anchor to namename•String!non-null
The automation name, shared by all versions.
- Anchor to notenote•String
The note stored on this version. Null if no note is set.
- •[String!]!non-null
The automation tags, shared by all versions. An empty list if none are set.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time when the automation was last updated.
- Anchor to validationErrorsvalidation•[Automation
Errors Workflow Validation Error!]! non-null Validation errors for this version, excluding resource availability errors. These errors don't prevent saving or reading the automation. An empty list doesn't guarantee that activation will succeed.
Show fields
- Anchor to versionversion•String!non-null
The identifier of this automation version. Draft edits and changes to name, tags, or note keep this identifier.
- Anchor to versionStateversion•Automation
State Workflow Version State! non-null The definition state of this automation version, independent of activation.
Show enum values
Anchor to QueriesQueries
- automationWorkflow (AutomationWorkflow)
- automationWorkflows (AutomationWorkflowConnection!)
- •query
Returns a saved automation version. Without a version, returns the latest draft or the most recently published version if no draft exists.
Show fields
- •ID!required
The ID of the automation to return.
- Anchor to versionversion•String
The automation version to return. Omit or use null to return the latest draft, or the most recently published version if no draft exists.
Arguments
- •ID!
- •query
Returns automations visible in the Flow editor, most recently updated first. Each result is the latest draft, or the most recently published version if no draft exists.
Show fields
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
Show filters
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
Anchor to MutationsMutations
- automationWorkflowActivate (AutomationWorkflowActivatePayload)
- automationWorkflowCreate (AutomationWorkflowCreatePayload)
- automationWorkflowDeactivate (AutomationWorkflowDeactivatePayload)
- automationWorkflowUpdate (AutomationWorkflowUpdatePayload)
- •mutation
Activates a specific automation version. Activating the currently active version succeeds without making changes, even when a newer draft exists.
Show payload
- •ID!required
The ID of the automation to activate.
- Anchor to versionversion•String!required
The version to activate. Must be the latest draft or the most recently published version. Activating the published version keeps any newer draft.
Arguments
- •ID!
- •mutation
Creates a draft automation from a JSON configuration.
Input errors are returned in
and nothing is saved. A saved draft can still have, such as a missing action or an incomplete configuration field; fix those before activating.Show payload
- Anchor to configurationconfiguration•JSON!required
The JSON configuration used to create the automation, including
__metadata.versionset to0.1androot. Define its logic inroot.steps,root.links, and. Supply name, tags, and note as separate arguments;,root.tags, androot.noteare rejected. See the workflow configuration JSON Schema.- Anchor to namename•String!required
The automation name, shared by all versions. Null and blank names are rejected.
- Anchor to notenote•String
The note for the new draft, separate from configuration and step notes. Omit or use null to leave it unset.
- •[String!]
The automation tags, shared by all versions. Omit or use null to create the automation with no tags.
Arguments
- •mutation
Deactivates a specific automation version and cancels its runs. An action already executing may still finish.
Show payload
- •ID!required
The ID of the automation to deactivate.
- Anchor to versionversion•String!required
The version to deactivate. Deactivating an inactive version succeeds without making changes.
Arguments
- •ID!
- •mutation
Updates an automation's name, tags, note, or configuration. Supply at least one editable field. Omitted fields keep their existing values.
Replacing the configuration edits the latest draft in place, or creates a draft if none exists. Any active version continues running with its existing configuration. Changes to the name, tags, or note don't create a draft.
Input errors are returned in
and nothing is saved. A saved version can still have; fix those before activating it.Show payload
- Anchor to configurationconfiguration•JSON
The full replacement JSON configuration, including
__metadata.versionandroot. Replaces the steps, links, and custom fields (). Supply name, tags, and note as separate arguments;,root.tags, androot.noteare rejected. Omit to leave the configuration unchanged. Null is rejected. See the workflow configuration JSON Schema.- •ID!required
The ID of the automation to update.
- Anchor to namename•String
The new automation name, shared by all versions. Omit to leave it unchanged. Null and blank names are rejected.
- Anchor to notenote•String
The note for the version being updated. Omit to leave it unchanged; use null to clear it.
- •[String!]
The replacement tags, shared by all versions. Omit or use null to leave them unchanged; use an empty list to clear them.
- Anchor to versionversion•String!required
The version this edit is based on. Use the latest draft, or the most recently published version when no draft exists. A different version returns
OUTDATED_WORKFLOW. Edits within the same draft and changes to name, tags, or note keep this identifier, so the check can't detect those edits.
Arguments