Reference: Gateway examples for Automate

Tanium Gateway provides a GraphQL API integration point for Tanium solutions, including Automate. Automate queries and mutations require Automate to create, retrieve, update, and delete playbooks and playbook runs, and start a playbook run from a playbook.

For more information about additional Gateway example syntax, see Reference: Filter syntax and Reference: Automate examples.

Automate query filter syntax

Automate queries that request playbook information (query.playbooks) support the following filter fields:

  • authorUserIDs

  • contentSets

  • createdAfterTime

  • createdBeforeTime

  • hasDisabledSchedules

  • ids

  • isScheduled

  • name

Automate queries that request playbook information support sorting the response on the following filter fields in ascending (asc) or descending (desc) order:

  • activeRunsCount based on number count

  • name based on alphabetical order

  • schedulesCount based on number count

If you do not define a sort order, the query defaults to sorting on name in asc order.

Automate queries that request playbook run information (query.playbookRuns) support the following filter fields:

  • createdAfterTime

  • createdBeforeTime

  • hasErrors

  • startReason.startTypes

  • playbookIDs

  • playbookName

  • runAsUserIDs

  • statuses

Automate queries that request playbook run information support sorting the response on the following filter fields in ascending (asc) or descending (desc) order:

  • endTime based on chronological order

  • name based on alphabetical order

  • scheduleStartTime based on chronological order

  • startTime based on chronological order

  • status based on playbook run lifecycle order, from creation to completion

If you do not define a sort order, the query defaults to sorting on status in asc order.

Automate queries that request playbook schedule information (query.playbookSchedules) support the following filter fields:

  • excludedScheduledByIDs

  • isEnabled

  • playbookIDs

  • scheduledByIDs

The playbooks, playbookRuns, and playbookSchedules queries require Automate 1.3 or later and the Automate Playbook read permission.

For more information on filter syntax, see PlaybookFieldFilter and PlaybookRunFieldFilter in the Documentation Explorer pane of the query explorer. For more information on sort syntax, see PlaybookFieldSort, PlaybookSortField, PlaybookRunFieldSort, and PlaybookRunSortField in the Documentation Explorer pane of the query explorer.

Playbooks belonging to a content set

You can retrieve playbooks belonging to a content set by content set ID or name. Define a filter object using the following syntax to filter by content set ID:

JSON
filter {
  contentSets:
    [
      {id: content-set-id-value-1},
      {id: content-set-id-value-2},
      {id: content-set-id-value-n}
    ]
}

Define a filter object using the following syntax to filter by content set name:

JSON
filter {
  contentSets:
    [
      {name: content-set-name-value-1},
      {name: content-set-name-value-2},
      {name: content-set-name-value-n}
    ]
}

For example, the following query retrieves the first two playbooks belonging to the content set with the ID 123:

JSON
query exampleGetPlaybooksContentSetID($first: Int, $contentSetID: ID) {
  playbooks(first: $first, filter: {contentSets: [{id: $contentSetID}]}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variable in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "contentSetID": "123"
}

The following query retrieves the first two playbooks belonging to the content set with the name Example content set:

JSON
query exampleGetPlaybooksContentSetName($first: Int, $contentSetName: String) {
  playbooks(first: $first, filter: {contentSets: [{name: $contentSetName}]}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variable in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "contentSetName": "Example content set"
}

Playbooks or playbook runs created after a time

You can retrieve playbooks and playbook runs created after a date. If you retrieve a playbook, you can also retrieve associated playbook runs created after a date. Define a filter object using the following syntax:

JSON
filter {
  createdAfterTime: time-value
}

For example, the following query retrieves the first two playbooks created after June 1, 2023:

JSON
query exampleGetPlaybooksAfter($first: Int, $create: Time) {
  playbooks(first: $first, filter: {createdAfterTime: $create}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "create": "2023-06-01T01:02:03Z"
}

The following query retrieves the first two playbook runs created after June 1, 2023:

JSON
query exampleGetPlaybookRunsAfter($first: Int, $create: Time) {
  playbookRuns(first: $first, filter: {createdAfterTime: $create}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "create": "2023-06-01T01:02:03Z"
}

Playbooks or playbook runs created before a time

You can retrieve playbooks and playbook runs created before a date. If you retrieve a playbook, you can also retrieve associated playbook runs created before a date. Define a filter object using the following syntax:

JSON
filter {
  createdBeforeTime: time-value
}

For example, the following query retrieves the first two playbooks created before June 1, 2023:

JSON
query exampleGetPlaybooksBefore($first: Int, $create: Time) {
  playbooks(first: $first, filter: {createdBeforeTime: $create}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "create": "2023-06-01T00:00:00Z"
}

The following query retrieves the first two playbook runs created before June 1, 2023:

JSON
query exampleGetPlaybookRunsBefore($first: Int, $create: Time) {
  playbookRuns(first: $first, filter: {createdBeforeTime: $create}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "create": "2023-06-01T00:00:00Z"
}

Playbooks configured with a playbook schedule

You can retrieve playbooks associated with at least one configured playbook schedule. Define a filter object using the following syntax:

JSON
filter {
  isScheduled: boolean-value
}

For example, the following query retrieves the first two playbooks with a configured schedule:

JSON
query exampleGetPlaybooksScheduled($first: Int, $isScheduled: Boolean) {
  playbooks(first: $first, filter: {isScheduled: $isScheduled}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "isScheduled": true
}

Playbooks configured with at least one disabled playbook schedule

You can retrieve playbooks associated with at least one configured playbook schedule that is also disabled. Define a filter object using the following syntax:

JSON
filter {
  hasDisabledSchedules: boolean-value
}

For example, the following query retrieves the first two playbooks with at least one configured schedule that is also disabled:

JSON
query exampleGetPlaybooksScheduleDisabled($first: Int, $hasDisabledSchedules: Boolean) {
  playbooks(first: $first, filter: {hasDisabledSchedules: $hasDisabledSchedules}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "hasDisabledSchedules": true
}

Playbooks with a referenced name

You can retrieve playbooks configured with a given name. Define a filter object using the following syntax:

JSON
filter {
  name: name-value
}

For example, the following query retrieves playbooks with the name Example playbook:

JSON
query exampleGetPlaybooksNamed($name: String) {
  playbooks(filter: {name: $name}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variable in the Variables panel or in your variables dictionary:

JSON
{
  "name": "Example playbook"
}

Playbooks with a referenced author ID

You can retrieve playbooks created by a given user ID. Define a filter object using the following syntax:

JSON
filter {
  authorUserIDs: [user-id-value-1,user-id-value-2,user-id-value-n]
}

For example, the following query retrieves the first two playbooks created by user ID 123:

JSON
query exampleGetPlaybooksAuthor($first: Int, $authorUserIDs: [ID!]) {
  playbooks(first: $first, filter: {authorUserIDs: $authorUserIDs}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variable in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "authorUserIDs": ["123"]
}

Playbooks with a referenced ID

You can retrieve playbooks with a given ID. Define a filter object using the following syntax:

JSON
filter {
  ids: [
    playbook-id-value-1,
    playbook-id-value-2,
    playbook-id-value-n
  ]
}

For example, the following query retrieves the playbooks with the IDs 12345678-90ab-cdef-1234-567890abcdef and fedcba09-8765-4321-fedc-ba0987654321:

JSON
query exampleGetPlaybooksByID($playbookID1: ID!, $playbookID2: ID!) {
  playbooks(filter: {ids: [$playbookID1, $playbookID2]}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "playbookID1": "12345678-90ab-cdef-1234-567890abcdef",
  "playbookID2": "fedcba09-8765-4321-fedc-ba0987654321"
}

Playbook runs and playbook schedules associated with a playbook ID

You can retrieve playbook runs and playbook schedules associated with a playbook, based on the playbook's ID. Define a filter object using the following syntax:

JSON
filter {
  playbookIDs: [
    playbook-id-1,
    playbook-id-2,
    playbook-id-n
  ]
}

The following query retrieves the first two playbook runs associated with the playbook ID 12345678-90ab-cdef-1234-567890abcdef:

JSON
query exampleGetPlaybookRunsPlaybookID($first: Int, $playbookID: ID!) {
  playbookRuns(first: $first, filter: {playbookIDs: [$playbookID]}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "playbookID": "12345678-90ab-cdef-1234-567890abcdef"
}

Playbook runs associated with a named playbook

You can retrieve playbook runs associated with a playbook, based on the playbook's name. This matches either the full playbook name or a string within the playbook name. For example, if you filter on example playbook in the playbook name, the playbook names example playbook and testing example playbook step both match. Define a filter object using the following syntax:

JSON
filter {
  playbookName: playbook-name
}

The following query retrieves the first two playbook runs associated with the playbook named Example named playbook:

JSON
query exampleGetPlaybookRunsPlaybookName($first: Int, $playbookName: String) {
  playbookRuns(first: $first, filter: {playbookName: $playbookName}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "playbookName": "Example named playbook"
}

Playbook runs associated with a runAs user ID

You can retrieve playbook runs whose runAs user matches the filter. If you retrieve a playbook, you can also retrieve associated playbook runs whose runAs user matches the filter. Define a filter object using the following syntax:

JSON
filter {
  runAsUserIDs: [
    user-ID-value-1,
    user-ID-value-2,
    user-ID-value-n..
  ]
}

The following query retrieves the first two playbook runs associated with the runAs user 1234:

JSON
query exampleGetPlaybookRunsUser($first: Int, $runAsUserID: ID!) {
  playbookRuns(first: $first, filter: {runAsUserIDs: [$runAsUserID]}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "runAsUserID": "1234"
}

Playbook runs by status

You can retrieve playbook runs based on their current status. If you retrieve a playbook, you can also retrieve associated playbook runs based on current status. Define a filter object using the following syntax:

JSON
filter {
  statuses: [
    enumerated-status-value-1,
    enumerated-status-value-2,
    enumerated-status-value-n
  ]
}

For information on playbook run status values, see PlaybookRunStatus in the Documentation Explorer pane of the query explorer.

The following query retrieves the first two playbook runs that are in progress:

JSON
query exampleGetPlaybookRunsStatus($first: Int, $status: [PlaybookRunStatus!]) {
  playbookRuns(first: $first, filter: {statuses: $status}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "status": "IN_PROGRESS"
}

Playbook runs initiated from a playbook schedule

You can retrieve playbook runs that were started due to a configured playbook schedule. Define a filter object using the following syntax:

JSON
filter {
  startReason: {startTypes: [SCHEDULE]}
}

The following query retrieves the first two playbook runs that started due to a configured playbook schedule:

JSON
query exampleGetPlaybookRunsStartedBySchedule($first: Int) {
  playbookRuns(first: $first, filter: {startReason: {startTypes: [SCHEDULE]}}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2
}

Playbook runs initiated by a user or trigger

You can retrieve playbook runs started due to a user action or from a trigger. Define a filter object using the following syntax:

JSON
filter {
  startReason: {startTypes: [USER, TRIGGER]}
}

The following query retrieves the first two playbook runs that started due to either a user action or a trigger:

JSON
query exampleGetPlaybookRunsStartedByUserOrTrigger($first: Int) {
  playbookRuns(first: $first, filter: {startReason: {startTypes: [USER, TRIGGER]}}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2
}

Playbook runs that generated errors

You can retrieve playbook runs that generated an error while running. If you retrieve a playbook, you can also retrieve associated playbook runs that generated an error. Define a filter object using the following syntax:

JSON
filter {
  hasErrors: boolean-value
}

The following query retrieves the first two playbook runs that generated an error while evaluating steps:

JSON
query exampleGetPlaybookRunsError($first: Int, $hasErrors: Boolean) {
  playbookRuns(first: $first, filter: {hasErrors: $hasErrors}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "hasErrors": true
}

Playbook schedules that are enabled

You can retrieve playbook schedules that are enabled. Define a filter object using the following syntax:

JSON
filter {
  isEnabled: boolean-value
}

The following query retrieves the first two enabled playbook schedules:

JSON
query exampleGetEnabledPlaybookSchedules($first: Int, $isEnabled: Boolean) {
  playbookSchedules(first: $first, filter: {isEnabled: $isEnabled}) {
    edges {
      node {
        createdTime
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "isEnabled": true
}

Playbook schedules that are created by a referenced user ID

You can retrieve playbook schedules that are created by a user based on user ID. Define a filter object using the following syntax:

JSON
filter {
  scheduledByIDs: [
    user-id-1,
    user-id-2,
    user-id-n
  ]
}

The following query retrieves the first two playbook schedules created by a user with the ID 123:

JSON
query exampleGetPlaybookScheduleUserID($first: Int, $scheduledByID: ID!) {
  playbookSchedules(first: $first, filter: {scheduledByIDs: [$scheduledByID]}) {
    edges {
      node {
        createdTime
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "scheduledByID": "123"
}

Playbook schedules that are not created by a referenced user ID

You can retrieve playbook schedules that are not created by a user based on user ID. Define a filter object using the following syntax:

JSON
filter {
  excludedScheduledByIDs: [
    user-id-1,
    user-id-2,
    user-id-n
  ]
}

The following query retrieves the first two playbook schedules that are not created by a user with the ID 123:

JSON
query exampleGetPlaybookScheduleNotUserID($first: Int, $excludedScheduledByID: ID!) {
  playbookSchedules(first: $first, filter: {excludedScheduledByIDs: [$excludedScheduledByID]}) {
    edges {
      node {
        createdTime
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2,
  "excludedScheduledByID": "123"
}

Playbooks or playbook runs results sorting

You can sort playbooks and playbook runs results. If you retrieve a playbook, you can also sort associated playbook runs. Define a sort object using the following syntax:

JSON
sort {
  field: field-name
  order: sort-order
}

For example, the following query sorts playbook results in descending order based on active run count:

JSON
query exampleGetPlaybooksSort($field: PlaybookSortField!, $order: SortOrder!) {
  playbooks(sort: {field: $field, order: $order}) {
    edges {
      node {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "field": "activeRunsCount",
  "order": "desc"
}

The following query sorts playbook run results in ascending order based on playbook run end time:

JSON
query exampleGetPlaybookRunsSort($field: PlaybookRunSortField!, $order: SortOrder!) {
  playbookRuns(sort: {field: $field, order: $order}) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
            taskArgument {
              __typename
            }
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the variables in the Variables panel or in your variables dictionary:

JSON
{
  "field": "endTime",
  "order": "asc"
}

Add a playbook Add Custom Tag (Non-Windows) step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Note: This step type extends the Deploy Action step for a specific package. If you add this step type using a GraphQL request instead of through Tanium Console, the step name appears as Deploy Action when you edit the playbook. Confirm the package ID and name for your environment, as it might differ from the example syntax.

The Add Custom Tag (Non-Windows) step requires the following permissions to deploy the Custom Tagging - Add Tags (Non-Windows) package:

  • Interact Execute action permission

  • Package read permission is required on the Core Content content set.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

Note: The Administrator reserved role, Content Administrator reserved role, and Interact Power User role have all these permissions.

For more information, see Action management permissions.

The Add Custom Tag (Non-Windows) step deploys the Custom Tagging - Add Tags (Non-Windows) package to targeted endpoints, which assigns one or more custom tags to targeted endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Custom Tagging - Add Tags (Non-Windows) package on the targeted endpoints belonging to the All Linux computer group:

JSON
mutation exampleUpsertPlaybookAddTagLinux($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_add_tag_non_windows",
    "description": "Example playbook - Add Tags to Non-Windows Machine step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_add_tag_non_windows_step",
        "description": "Example step 1: Add Tags to Non-Windows Machines",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Linux"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1200
            },
            "completionPercentage": 1,
            "package": {
              "id": "36",
              "name": "Custom Tagging - Add Tags (Non-Windows)",
              "params": [
                "example_tag"
              ]
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_add_tag_non_windows",
        "steps": [
          {
            "description": "Example step 1: Add Tags to Non-Windows Machines",
            "name": "example_add_tag_non_windows_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Add Custom Tag (Windows) step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Note: This step type extends the Deploy Action step for a specific package. If you add this step type using a GraphQL request instead of through Tanium Console, the step name appears as Deploy Action when you edit the playbook. Confirm the package ID and name for your environment, as it might differ from the example syntax.

The Add Custom Tag (Windows) step requires the following permissions to deploy the Custom Tagging - Add Tags package:

  • Interact Execute action permission

  • Package read permission is required on the Core Content content set.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

Note: The Administrator reserved role, Content Administrator reserved role, and Interact Power User role have all these permissions.

For more information, see Action management permissions.

The Add Custom Tag (Windows) step deploys the Custom Tagging - Add Tags package to targeted endpoints, which assigns one or more custom tags to targeted endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Custom Tagging - Add Tags package on the targeted endpoints belonging to the All Windows computer group:

JSON
mutation exampleUpsertPlaybookAddTagWindows($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_add_tag_windows",
    "description": "Example playbook - Add Tags to Windows Machine step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_add_tag_windows_step",
        "description": "Example step 1: Add Tags to Windows Machines",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1200
            },
            "completionPercentage": 1,
            "package": {
              "id": "35",
              "name": "Custom Tagging - Add Tags",
              "params": [
                "example_tag"
              ]
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_add_tag_windows",
        "steps": [
          {
            "description": "Example step 1: Add Tags to Windows Machines",
            "name": "example_add_tag_windows_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Deploy Action step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

The Deploy Action step requires the following permissions to deploy actions, including action locks:

  • Interact Execute action permission

  • Package read permission on content sets determine which packages are available for selection in actions.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

Note: The Administrator reserved role, Content Administrator reserved role, and Interact Power User role have all these permissions.

For more information, see Action management permissions.

The Deploy Action step deploys an action that runs a package on targeted endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Example Package package on the targeted endpoints belonging to the All Windows computer group:

JSON
mutation exampleUpsertPlaybookDeployAction($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_deploy_action",
    "description": "Example playbook - Deploy action step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_deploy_action_step",
        "description": "Example step 1: Deploy example package",
        "endpointTargeting": {
          "memberOf": {
            "name": "All Windows"
          },
          "negated": false,
          "any": true
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 12000
            },
            "completionPercentage": 1,
            "package": {
              "name": "Example package"
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_deploy_action",
        "steps": [
          {
            "description": "Example step 1: Deploy example package",
            "name": "example_deploy_action_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add email notifications to a playbook

(mutation.upsertPlaybook (input.notificationSettings.email))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

You can configure a playbook to send email notifications to recipient email addresses based on playbook run events. For information on the available playbook run event types, see PlaybookNotificationEventType in the Documentation Explorer.

The following mutation creates a playbook, because no ID is specified in the input, and defines email notifications when a playbook run starts or ends:

JSON
mutation exampleUpsertPlaybookEmailNotification($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      contentSet {
        name
      }
      createdTime
      description
      id
      name
      notificationSettings {
        email {
          events
          recipients
        }
      }
      startingStep {
        id
        name
        description
      }
      steps {
        id
        description
        name
        nextStep {
          id
          name
          taskArgument {
            __typename
          }
        }
        previousStep {
          id
          name
          taskArgument {
            __typename
          }
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_upsert_create",
    "description": "Example playbook upsert create",
    "contentSet": {
      "id": "1234"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "12345678-90ab-cdef-1234-567890abcdef",
    "steps": [
      {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_step_1",
        "description": "Example step 1: Initiation",
        "nextStepID": "22345678-90ab-cdef-1234-567890abcde2",
        "taskArgument": {
          "instruction": {
            "instruction": "# Initiate (start) this step, then confirm when complete."
          }
        }
      },
      {
        "id": "22345678-90ab-cdef-1234-567890abcde2",
        "name": "example_step_2",
        "description": "Example step 2: Processing",
        "nextStepID": "32345678-90ab-cdef-1234-567890abcde3",
        "taskArgument": {
          "instruction": {
            "instruction": "# Work (Process) this step, then confirm when complete."
          }
        }
      },
      {
        "id": "32345678-90ab-cdef-1234-567890abcde3",
        "name": "example_step_3",
        "description": "Example step 3: Resolution",
        "nextStepID": null,
        "taskArgument": {
          "instruction": {
            "instruction": "# Finish (Resolve) this step, then confirm when complete."
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "contentSet": {
          "name": "Automate"
        },
        "createdTime": "2024-08-06T14:26:32.079536Z",
        "description": "Example playbook upsert create",
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_playbook_upsert_create",
        "notificationSettings": {
          "email": {
            "events": [
              "START",
              "END"
            ],
            "recipients": [
              "host@example.com"
            ]
          }
        },
        "startingStep": {
          "id": "12345678-90ab-cdef-1234-567890abcdef",
          "name": "example_step_1",
          "description": "Example step 1: Initiation"
        },
        "steps": [
          {
            "id": "12345678-90ab-cdef-1234-567890abcdef",
            "description": "Example step 1: Initiation",
            "name": "example_step_1",
            "nextStep": {
              "id": "22345678-90ab-cdef-1234-567890abcde2",
              "name": "example_step_2",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            },
            "previousStep": null
          },
          {
            "id": "22345678-90ab-cdef-1234-567890abcde2",
            "description": "Example step 2: Processing",
            "name": "example_step_2",
            "nextStep": {
              "id": "32345678-90ab-cdef-1234-567890abcde3",
              "name": "example_step_3",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            },
            "previousStep": {
              "id": "12345678-90ab-cdef-1234-567890abcdef",
              "name": "example_step_1",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            }
          },
          {
            "id": "32345678-90ab-cdef-1234-567890abcde3",
            "description": "Example step 3: Resolution",
            "name": "example_step_3",
            "nextStep": null,
            "previousStep": {
              "id": "22345678-90ab-cdef-1234-567890abcde2",
              "name": "example_step_2",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Linux Quarantine step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Note: This step type extends the Deploy Action step for a specific package. If you add this step type using a GraphQL request instead of through Tanium Console, the step name appears as Deploy Action when you edit the playbook. Confirm the package ID and name for your environment, as it might differ from the example syntax.
Important: You must have the Content Administrator reserved role for Tanium Console. For more information, see Managing access permissions through roles.

The Linux Quarantine step requires the following permissions to deploy the Threat Response - Quarantine Endpoint Template [Linux] package:

  • Interact Execute action permission

  • Package read permission is required on the Incident Response content set.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

For more information, see Action management permissions.

The Linux Quarantine step deploys the Threat Response - Quarantine Endpoint Template [Linux] package to targeted endpoints, which isolates a targeted endpoint from the network. For information about quarantining endpoints, see Quarantining endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Threat Response - Quarantine Endpoint Template [Linux] package on the targeted endpoints belonging to the All Linux computer group:

JSON
mutation exampleUpsertPlaybookQuarantineLinux($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_quarantine_linux",
    "description": "Example playbook - Quarantine Linux step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_quarantine_linux_step",
        "description": "Example step 1: Quarantine Linux",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Linux"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1800
            },
            "completionPercentage": 1,
            "package": {
              "name": "Threat Response - Quarantine Endpoint Template [Linux]",
              "params": [
                "1",
                "1",
                "1",
                "1",
                "1",
                "1",
                "example notification",
                "IN:UDP:10.0.0.21:32:161\nOUT:UDP:10.0.0.21:32:162",
                "192.0.2.10",
                "192.0.2.20",
                "1",
                ""
              ]
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_quarantine_linux",
        "steps": [
          {
            "description": "Example step 1: Quarantine Linux",
            "name": "example_quarantine_linux_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Manual Instruction step

(mutation.upsertPlaybook (input.steps), mutation.playbookRunPerformOperation)

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

The Manual Instruction step displays an instruction, generally in Markdown format, to the Tanium operator. The Tanium operator must confirm the completion to allow the playbook to proceed to the next step.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Manual Instruction step, which shows information to a Tanium operator:

JSON
mutation exampleUpsertPlaybookManualInstruction($input: PlaybookUpsertInput!) {
  playbookUpsert(
    input: $input
  ) {
    playbook {
      createdTime
      description
      id
      name
      revision
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_manual_instruction",
    "description": "Example playbook - Manual Instruction step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": ["START", "END"],
        "recipients": ["host@example.com"]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_manual_instruction_step",
        "description": "Example step 1: External process",
        "taskArgument": {
          "instruction": {
            "instruction": "# Check the external system output. Confirm this step when complete."
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "createdTime": "2023-08-21T13:15:58.764932Z",
        "description": "Example playbook - Manual Instruction step",
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_manual_instruction",
        "revision": 1,
        "steps": [
          {
            "description": "Example step 1: External process",
            "name": "example_manual_instruction_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentInstruction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

For a running playbook with a Manual Instruction step at index 0, the following mutation issues the step confirmation.

Note: The PlaybookRunOperation object enumerates available playbook run operations.
JSON
mutation exampleConfirmPlaybookRunStep($input: PlaybookRunPerformOperationInput!) {
  playbookRunPerformOperation(
    input: $input
  ) {
    playbookRun {
      createdTime
      endTime
      events {
        createdTime
        initiator {
          persona {
            id
          }
          user {
            id
          }
        }
        name
      }
      id
      playbook {
        id
      }
      runAs {
        persona {
          id
        }
        user {
          id
        }
      }
      scheduleStartTime
      startTime
      status
      steps {
        confirmationResult {
          comment
          completedUser {
            id
          }
          completionTime
        }
        endTime
        playbookStep {
          description
          name
        }
        startTime
        status
        error
      }
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "fedcba09-8765-4321-fedc-ba0987654321",
    "operation": "CONFIRM_STEP",
    "parameters": {
      "confirmStep": {
        "runStepIndex": 0,
        "comment": "# Example confirmation of Manual Instruction step."
      }
    }
  }
}

Example response:

JSON
{
  "data": {
    "playbookRunPerformOperation": {
      "playbookRun": {
        "createdTime": "2023-08-21T13:48:30.173539Z",
        "endTime": null,
        "events": [
          {
            "createdTime": "2023-08-21T06:48:30.1720982-07:00",
            "initiator": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "name": "CREATE"
          },
          {
            "createdTime": "2023-08-21T13:48:30.1800994Z",
            "initiator": null,
            "name": "START"
          },
          {
            "createdTime": "2023-08-21T13:48:30.2041051Z",
            "initiator": null,
            "name": "WAIT"
          },
          {
            "createdTime": "2023-08-21T06:51:37.6948538-07:00",
            "initiator": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "name": "CONFIRM"
          }
        ],
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "playbook": {
          "id": "12345678-90ab-cdef-1234-567890abcdef"
        },
        "runAs": {
          "persona": null,
          "user": {
            "id": "1"
          }
        },
        "scheduleStartTime": null,
        "startTime": "2023-08-21T13:48:30.180099Z",
        "status": "IN_PROGRESS",
        "steps": [
          {
            "confirmationResult": {
              "comment": "# Example confirmation of Manual Instruction step.",
              "completedUser": {
                "id": "1"
              },
              "completionTime": "2023-08-21T06:51:37.6948538-07:00"
            },
            "endTime": null,
            "playbookStep": {
              "description": "Example step 1: External process",
              "name": "example_manual_instruction_step"
            },
            "startTime": "2023-08-21T13:48:30.2041051Z",
            "status": "IN_PROGRESS",
            "error": ""
          }
        ]
      }
    }
  }
}

Add a playbook Reboot Non-Windows Machine step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Note: This step type extends the Deploy Action step for a specific package. If you add this step type through a GraphQL request instead of through Tanium Console, the step name appears as Deploy Action when you edit the playbook. Confirm the package ID and name for your environment, as it might differ from the example syntax.

The Reboot Non-Windows Machine step requires the following permissions to deploy the Reboot Non-Windows Machine package:

  • Interact Execute action permission

  • Package read permission on the Core Content content set.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

Note: The Administrator reserved role, Content Administrator reserved role, and Interact Power User role have all these permissions.

For more information, see Action management permissions.

The Reboot Non-Windows Machine step deploys the Reboot Non-Windows Machine package to targeted endpoints, which reboots the endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Reboot Non-Windows Machine package on the targeted endpoints belonging to the All Linux computer group:

JSON
mutation exampleUpsertPlaybookRebootNonWindows($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_reboot_non_windows",
    "description": "Example playbook - Reboot Non-Windows Machine step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_reboot_non_windows_step",
        "description": "Example step 1: Reboot Non-Windows Machines",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Linux"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1200
            },
            "completionPercentage": 1,
            "package": {
              "id": "47",
              "name": "Reboot Non-Windows Machine",
              "params": [
                "REBOOT",
                "30"
              ]
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_reboot_non_windows",
        "steps": [
          {
            "description": "Example step 1: Reboot Non-Windows Machines",
            "name": "example_reboot_non_windows_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Reboot Windows Machine step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Note: This step type extends the Deploy Action step for a specific package. If you add this step type using a GraphQL request instead of through Tanium Console, the step name appears as Deploy Action when you edit the playbook. Confirm the package ID and name for your environment, as it might differ from the example syntax.

The Reboot Windows Machine step requires the following permissions to deploy the Reboot Windows Machine package:

  • Interact Execute action permission

  • Package read permission on the Core Content content set.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

Note: The Administrator reserved role, Content Administrator reserved role, and Interact Power User role have all these permissions.

For more information, see Action management permissions.

The Reboot Windows Machine step deploys the Reboot Windows Machine package to targeted endpoints, which reboots the endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Reboot Windows Machine package on the targeted endpoints belonging to the All Windows computer group:

JSON
mutation exampleUpsertPlaybookRebootWindows($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_reboot_windows",
    "description": "Example playbook - Reboot Windows Machine step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_reboot_windows_step",
        "description": "Example step 1: Reboot Windows Machines",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1200
            },
            "completionPercentage": 1,
            "package": {
              "id": "47",
              "name": "Reboot Windows Machine",
              "params": [
                "REBOOT",
                "yes",
                "30"
              ]
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_reboot_windows",
        "steps": [
          {
            "description": "Example step 1: Reboot Windows Machines",
            "name": "example_reboot_windows_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Remove Linux Quarantine step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Note: This step type extends the Deploy Action step for a specific package. If you add this step type using a GraphQL request instead of through Tanium Console, the step name appears as Deploy Action when you edit the playbook. Confirm the package ID and name for your environment, as it might differ from the example syntax.
Important: You must have the Content Administrator reserved role for Tanium Console. For more information, see Managing access permissions through roles.

The Remove Linux Quarantine step requires the following permissions to deploy the Threat Response - Unquarantine Endpoint [Linux] package:

  • Interact Execute action permission

  • Package read permission is required on the Incident Response content set.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

For more information, see Action management permissions.

The Remove Linux Quarantine step deploys the Threat Response - Unquarantine Endpoint [Linux] package to targeted endpoints, which restores network connectivity to a targeted quarantined endpoint. For information about quarantining endpoints, see Quarantining endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Threat Response - Unquarantine Endpoint [Linux] package on the targeted endpoints that belong to the All Linux computer group:

JSON
mutation exampleUpsertPlaybookRemoveQuarantineLinux($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_remove_quarantine_linux",
    "description": "Example playbook - Remove Quarantine Linux step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_remove_quarantine_linux_step",
        "description": "Example step 1: Remove Quarantine Linux",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Linux"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1800
            },
            "completionPercentage": 1,
            "package": {
              "name": "Threat Response - Unquarantine Endpoint [Linux]"
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_remove_quarantine_linux",
        "steps": [
          {
            "description": "Example step 1: Remove Quarantine Linux",
            "name": "example_remove_quarantine_linux_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Remove Windows Quarantine step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Note: This step type extends the Deploy Action step for a specific package. If you add this step type using a GraphQL request instead of through Tanium Console, the step name appears as Deploy Action when you edit the playbook. Confirm the package ID and name for your environment, as it might differ from the example syntax.
Important: You must have the Content Administrator reserved role for Tanium Console. For more information, see Managing access permissions through roles.

The Remove Windows Quarantine step requires the following permissions to deploy the Threat Response - Unquarantine Endpoint [Windows] package:

  • Interact Execute action permission

  • Package read permission is required on the Incident Response content set.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

For more information, see Action management permissions.

The Remove Windows Quarantine step deploys the Threat Response - Unquarantine Endpoint [Windows] package to targeted endpoints, which restores network connectivity to a targeted quarantined endpoint. For information about quarantining endpoints, see Quarantining endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Threat Response - Unquarantine Endpoint [Windows] package on the targeted endpoints belonging to the All Windows computer group:

JSON
mutation exampleUpsertPlaybookRemoveQuarantineWindows($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_remove_quarantine_windows",
    "description": "Example playbook - Remove Quarantine Windows step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_remove_quarantine_windows_step",
        "description": "Example step 1: Remove Quarantine Windows",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1800
            },
            "completionPercentage": 1,
            "package": {
              "name": "Threat Response - Unquarantine Endpoint [Windows]"
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_remove_quarantine_windows",
        "steps": [
          {
            "description": "Example step 1: Remove Quarantine Windows",
            "name": "example_remove_quarantine_windows_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Require User Confirmation step

(mutation.upsertPlaybook (input.steps), mutation.playbookRunPerformOperation)

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

The Require User Confirmation step displays an instruction, generally in Markdown format, to the Tanium operator. This step requires a Tanium operator to confirm that the playbook can proceed to the next step.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Require User Confirmation step, which displays information to a Tanium operator and requires user confirmation before continuing to the next playbook run step:

JSON
mutation exampleUpsertPlaybookUserConfirmation($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      createdTime
      description
      id
      name
      revision
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_require_user_confirmation",
    "description": "Example playbook - Require User Confirmation step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": ["START", "END"],
        "recipients": ["host@example.com"]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_require_user_confirmation_step",
        "description": "Example step 1: Verification",
        "taskArgument": {
          "confirmation": {
            "instruction": "# Verify that the system is running, then confirm when complete."
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "createdTime": "2023-08-21T13:15:58.764932Z",
        "description": "Example playbook - Require User Confirmation step",
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_require_user_confirmation",
        "revision": 1,
        "steps": [
          {
            "description": "Example step 1: Verification",
            "name": "example_require_user_confirmation_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentConfirmation"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

For a running playbook with a Require User Confirmation step at index 0, the following mutation issues the step confirmation.

Note: The PlaybookRunOperation object enumerates available playbook run operations.
JSON
mutation exampleConfirmPlaybookRunStep($input: PlaybookRunPerformOperationInput!) {
  playbookRunPerformOperation(
    input: $input
  ) {
    playbookRun {
      createdTime
      endTime
      events {
        createdTime
        initiator {
          persona {
            id
          }
          user {
            id
          }
        }
        name
      }
      id
      playbook {
        id
      }
      runAs {
        persona {
          id
        }
        user {
          id
        }
      }
      scheduleStartTime
      startTime
      status
      steps {
        confirmationResult {
          comment
          completedUser {
            id
          }
          completionTime
        }
        endTime
        playbookStep {
          description
          name
        }
        startTime
        status
        error
      }
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "dfe531d2-634c-4143-b80b-2e1e3987f6e8",
    "operation": "CONFIRM_STEP",
    "parameters": {
      "confirmStep": {
        "runStepIndex": 0,
        "comment": "# Example confirmation of Require User Confirmation step."
      }
    }
  }
}

Example response:

JSON
{
  "data": {
    "playbookRunPerformOperation": {
      "playbookRun": {
        "createdTime": "2023-08-21T13:29:18.306899Z",
        "endTime": null,
        "events": [
          {
            "createdTime": "2023-08-21T06:29:18.3059042-07:00",
            "initiator": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "name": "CREATE"
          },
          {
            "createdTime": "2023-08-21T13:29:18.3089013Z",
            "initiator": null,
            "name": "START"
          },
          {
            "createdTime": "2023-08-21T13:29:18.332902Z",
            "initiator": null,
            "name": "WAIT"
          },
          {
            "createdTime": "2023-08-21T06:31:25.3657962-07:00",
            "initiator": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "name": "CONFIRM"
          }
        ],
        "id": "dfe531d2-634c-4143-b80b-2e1e3987f6e8",
        "playbook": {
          "id": "12345678-90ab-cdef-1234-567890abcdef"
        },
        "runAs": {
          "persona": null,
          "user": {
            "id": "1"
          }
        },
        "scheduleStartTime": null,
        "startTime": "2023-08-21T13:29:18.308901Z",
        "status": "IN_PROGRESS",
        "steps": [
          {
            "confirmationResult": {
              "comment": "# Example confirmation of Require User Confirmation step.",
              "completedUser": {
                "id": "1"
              },
              "completionTime": "2023-08-21T06:31:25.3657962-07:00"
            },
            "endTime": null,
            "playbookStep": {
              "description": "Example step 1: Verification",
              "name": "example_require_user_confirmation_step"
            },
            "startTime": "2023-08-21T13:29:18.332902Z",
            "status": "IN_PROGRESS",
            "error": ""
          }
        ]
      }
    }
  }
}

Add steps that inherit endpoint targeting

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

When configuring steps that target endpoints, note the following:

  • Targeting inheritance relies upon referencing a prior step ID. When creating a playbook, manually assign a step ID for reference. Ensure that the step ID is unique, to avoid step ID reference collision issues when resolving a referenced step ID. Playbook steps without a user-defined ID are assigned a GUID in the format 12345678-90ab-cdef-1234-567890abcdef.

  • Not all steps target endpoints. For example, the Wait step waits for the configured amount of time before the playbook run proceeds to the next step, without targeting endpoints.

  • You cannot inherit targeting from a Verify Condition step.

  • If a step targets endpoints, such as (input.steps.endpointTargeting), you must define one, and only one, of customTargeting, previousStepTargeting, or previousStepCompletedTargeting.

    • customTargeting supports targeting endpoints based on computer group membership, sensor evaluation, or a combination of both. For more information on supported syntax, see ComputerGroupFilter in the Documentation Explorer.

    • previousStepTargeting targets the same endpoints as a prior targeting step index value in the playbook step array.

    • previousStepCompletedTargeting targets the endpoints that completed the prior targeting step in the playbook step array.

  • If the first step in a playbook targets endpoints, you must define customTargeting. Because no steps precede the first step, you cannot inherit targeting from prior steps.

  • For any step in a playbook that targets endpoints after the first step, you can define customTargeting for the step, or inherit endpoint targeting using either previousStepTargeting or previousStepCompletedTargeting, referencing a prior step index.

  • If you inherit endpoint targeting with either previousStepTargeting or previousStepCompletedTargeting, and the referenced step index does not target endpoints, the evaluation traverses backwards from the referenced step to find a step that targets endpoints, then uses that step targeting. If no steps in this evaluation target endpoints, this results in an error.

  • Depending on the step type, additional endpoint filtering might be required to narrow the targeted endpoints, regardless of endpoint targeting method.

The following mutation creates a playbook, because no ID is specified in the input, and defines three steps:

  • step ID 12345678-90ab-cdef-1234-567890abcdef: a Deploy Action step that uses the Custom Tagging - Add Tags to apply the example-tag tag to endpoints in the All Windows computer group

  • step ID 02345678-90ab-cdef-1234-567890abcde0: a Deploy Action step that inherits endpoint targeting from step ID 12345678-90ab-cdef-1234-567890abcdef and defines the All Windows 10 computer group as an additional filter

  • step ID 92345678-90ab-cdef-1234-567890abcde9: a Verify Condition step that sets a successPercentage value of 1 (100%) of all endpoints that completed step ID 02345678-90ab-cdef-1234-567890abcde0

JSON
mutation exampleUpsertPlaybookStepInheritance($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      createdTime
      description
      id
      name
      revision
      steps {
        id
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_target_inheritance",
    "description": "Example playbook - Step target inheritance",
    "contentSet": {
      "id": "1234"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "12345678-90ab-cdef-1234-567890abcdef",
    "steps": [
      {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_add_tag_windows_step",
        "description": "Example step 1: Add Tags to Windows Machines",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "nextStepID": "02345678-90ab-cdef-1234-567890abcde0",
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 12000
            },
            "completionPercentage": 1,
            "package": {
              "id": "35",
              "name": "Custom Tagging - Add Tags",
              "params": [
                "example_tag"
              ]
            }
          }
        }
      },
      {
        "id": "02345678-90ab-cdef-1234-567890abcde0",
        "name": "example_deploy_action_step",
        "description": "Example step 2: Deploy action to Windows 10",
        "endpointTargeting": {
          "previousStepTargetingID": "12345678-90ab-cdef-1234-567890abcdef"
        },
        "nextStepID": "92345678-90ab-cdef-1234-567890abcde9",
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "name": "All Windows 10"
            },
            "completionPercentage": 1,
            "package": {
              "name": "Custom Tagging - Add Tags"
            }
          }
        }
      },
      {
        "id": "92345678-90ab-cdef-1234-567890abcde9",
        "name": "example_verify_condition_step",
        "description": "Example step 3: Check for virtual Windows utility run",
        "endpointTargeting": {
          "previousStepCompletedTargetingID": "02345678-90ab-cdef-1234-567890abcde0"
        },
        "taskArgument": {
          "verifyCondition": {
            "endpointFilter": {
              "sensor": {
                "name": "Is Virtual"
              },
              "op": "EQ",
              "value": "true",
              "negated": false,
              "any": false
            },
            "successPercentage": 1
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "createdTime": "2023-09-28T18:29:34.408097Z",
        "description": "Example playbook - Step target inheritance",
        "id": "52345678-90ab-cdef-1234-567890abcde5",
        "name": "example_playbook_target_inheritance",
        "revision": 1,
        "steps": [
          {
            "id": "12345678-90ab-cdef-1234-567890abcdef",
            "description": "Example step 1: Add Tags to Windows Machines",
            "name": "example_add_tag_windows_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          },
          {
            "id": "02345678-90ab-cdef-1234-567890abcde0",
            "description": "Example step 2: Deploy action to Windows 10",
            "name": "example_deploy_action_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          },
          {
            "id": "92345678-90ab-cdef-1234-567890abcde9",
            "description": "Example step 3: Check for virtual Windows utility run",
            "name": "example_verify_condition_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentVerifyCondition"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

The following mutation creates a playbook, because no ID is specified in the input, and defines the following steps:

  • step one: a Deploy Action step that deploys the Custom Tagging - Add Tags package to all endpoints in the All Windows computer group and sets a completionPercentage value of 1.0 (100%) of endpoints

  • step two: a Verify Condition step that checks that all endpoints in the All Windows computer group are not virtual

  • step three: a Require User Confirmation step that does not target endpoints

  • step four: a Wait step that does not target endpoints

  • step five: a Require User Confirmation step that does not target endpoints

  • step six: a Deploy Action step that sets a successPercentage value of 1.0 (100%) of all endpoints that completed step one

The endpoint targeting for step six references the endpoint targeting for step one, and does not consider any endpoint targeting or lack of endpoint targeting in steps two, three, four, or five.

JSON
mutation exampleUpsertPlaybookStepInheritanceSkip($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      createdTime
      description
      id
      name
      revision
      steps {
        id
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_target_inheritance",
    "description": "Example playbook - Step target inheritance",
    "contentSet": {
      "id": "1234"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "12345678-90ab-cdef-1234-567890abcdef",
    "steps": [
      {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_add_tag_windows_step",
        "description": "Example step 1: Add Tags to Windows Machines",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "nextStepID": "22345678-90ab-cdef-1234-567890abcde2",
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 12000
            },
            "completionPercentage": 1,
            "package": {
              "id": "35",
              "name": "Custom Tagging - Add Tags",
              "params": [
                "example_tag"
              ]
            }
          }
        }
      },
      {
        "id": "22345678-90ab-cdef-1234-567890abcde2",
        "name": "example_verify_condition_step",
        "description": "Example step 2: Check for physical Windows",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "nextStepID": "32345678-90ab-cdef-1234-567890abcde3",
        "taskArgument": {
          "verifyCondition": {
            "endpointFilter": {
              "sensor": {
                "name": "Is Virtual"
              },
              "op": "EQ",
              "value": "false",
              "negated": false,
              "any": false
            },
            "successPercentage": 1
          }
        }
      },
      {
        "id": "32345678-90ab-cdef-1234-567890abcde3",
        "name": "example_confirmation_step",
        "description": "Example step 3: Confirm Windows workstations online",
        "nextStepID": "42345678-90ab-cdef-1234-567890abcde4",
        "taskArgument": {
          "confirmation": {
            "instruction": "Verify that critical Windows workstations are online, then confirm this step."
          }
        }
      },
      {
        "id": "42345678-90ab-cdef-1234-567890abcde4",
        "name": "example_wait_step",
        "description": "Example step 4: Wait twelve hours for background processes",
        "nextStepID": "52345678-90ab-cdef-1234-567890abcde5",
        "taskArgument": {
          "wait": {
            "duration": {
              "seconds": 43200
            }
          }
        }
      },
      {
        "id": "52345678-90ab-cdef-1234-567890abcde5",
        "name": "example_additional_confirmation_step",
        "description": "Example step 5: Confirm background processes did not error",
        "nextStepID": "62345678-90ab-cdef-1234-567890abcde6",
        "taskArgument": {
          "confirmation": {
            "instruction": "Verify that overnight processes ran in the C:\\logs\\overnight\\[date]-[time]-overnight-[index-value].log files. If any errors in the log, contact network admin on call. Otherwise, confirm this step."
          }
        }
      },
      {
        "id": "62345678-90ab-cdef-1234-567890abcde6",
        "name": "example_deploy_action_step",
        "description": "Example step 6: Deploy action to copy log info on important physical Windows workstations",
        "endpointTargeting": {
          "previousStepTargetingID": "12345678-90ab-cdef-1234-567890abcdef"
        },
        "nextStepID": null,
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "name": "Critical Hardware"
            },
            "completionPercentage": 1,
            "package": {
              "name": "Copy Log Info"
            }
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "createdTime": "2024-05-06T19:48:33.601759Z",
        "description": "Example playbook - Step target inheritance",
        "id": "f635b09c-93e9-44e5-8094-6dc7c5a420ac",
        "name": "example_playbook_target_inheritance",
        "revision": 1,
        "steps": [
          {
            "id": "12345678-90ab-cdef-1234-567890abcdef",
            "description": "Example step 1: Add Tags to Windows Machines",
            "name": "example_add_tag_windows_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          },
          {
            "id": "22345678-90ab-cdef-1234-567890abcde2",
            "description": "Example step 2: Check for physical Windows",
            "name": "example_verify_condition_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentVerifyCondition"
            }
          },
          {
            "id": "32345678-90ab-cdef-1234-567890abcde3",
            "description": "Example step 3: Confirm Windows workstations online",
            "name": "example_confirmation_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentConfirmation"
            }
          },
          {
            "id": "42345678-90ab-cdef-1234-567890abcde4",
            "description": "Example step 4: Wait twelve hours for background processes",
            "name": "example_wait_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentWait"
            }
          },
          {
            "id": "52345678-90ab-cdef-1234-567890abcde5",
            "description": "Example step 5: Confirm background processes did not error",
            "name": "example_additional_confirmation_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentConfirmation"
            }
          },
          {
            "id": "62345678-90ab-cdef-1234-567890abcde6",
            "description": "Example step 6: Deploy action to copy log info on important physical Windows workstations",
            "name": "example_deploy_action_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Verify Condition step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

The Verify Condition step evaluates the percentage of targeted endpoints that answered a Tanium question, compared to the total number of endpoints managed using Tanium Client. The step is considered complete when 95% of endpoints have responded, or after ten minutes elapse (the question expiration interval). If the percentage meets or exceeds the defined successPercentage value, the step completes and the playbook run moves to the next step. Otherwise, the playbook run ends.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Verify Condition step that sets a successPercentage value of 0.501 (50.1%) of endpoints in the All Windows computer group that are not virtual:

JSON
mutation exampleUpsertPlaybookVerifyCondition($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      createdTime
      description
      id
      name
      revision
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_verify_condition",
    "description": "Example playbook - Verify Condition step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_verify_condition_step",
        "description": "Example step 1: Check for virtual Windows",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "verifyCondition": {
            "endpointFilter": {
              "sensor": {
                "name": "Is Virtual"
              },
              "op": "EQ",
              "value": "true"
            },
            "successPercentage": 0.501
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "createdTime": "2023-08-21T13:15:58.764932Z",
        "description": "Example playbook - Verify Condition step",
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_verify_condition",
        "revision": 1,
        "steps": [
          {
            "description": "Example step 1: Check for virtual Windows",
            "name": "example_verify_condition_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentVerifyCondition"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Wait step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

The Wait step waits for a configured amount of time, then moves to the next step in the playbook run.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Wait step, which waits the specified duration of 60 seconds before continuing to the next playbook run step:

JSON
mutation exampleUpsertPlaybookWait($input: PlaybookUpsertInput!) {
  playbookUpsert(
    input: $input
  ) {
    playbook {
      createdTime
      description
      id
      name
      revision
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_wait_step",
    "description": "Example playbook - Wait step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_wait_step",
        "description": "Example step 1: Wait 1 minute",
        "taskArgument": {
          "wait": {
            "duration": {
              "nanoseconds": 0,
              "seconds": 60
            }
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "createdTime": "2024-08-06T17:16:21.467859Z",
        "description": "Example playbook - Wait step",
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_wait_step",
        "revision": 2,
        "steps": [
          {
            "description": "Example step 1: Wait 1 minute",
            "name": "example_wait_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentWait"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Add a playbook Windows Quarantine step

(mutation.upsertPlaybook (input.steps))

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Note: This step type extends the Deploy Action step for a specific package. If you add this step type using a GraphQL request instead of through Tanium Console, the step name appears as Deploy Action when you edit the playbook. Confirm the package ID and name for your environment, as it might differ from the example syntax.
Important: You must have the Content Administrator reserved role for Tanium Console. For more information, see Managing access permissions through roles.

The Windows Quarantine step requires the following permissions to deploy the Threat Response - Quarantine Endpoint Template [Windows] package:

  • Interact Execute action permission

  • Package read permission is required on the Incident Response content set.

  • Sensor read and Saved Question read permissions are required on the Reserved content set. The Tanium Server uses special saved questions to track and report action status within the deploy action workflow. Therefore, these permissions are required to complete the action deployment workflow.

For more information, see Action management permissions.

The Windows Quarantine step deploys the Threat Response - Quarantine Endpoint Template [Windows] package to targeted endpoints, which isolates a targeted endpoint from the network. For information about how to quarantine endpoints, see Quarantining endpoints.

The following mutation creates a playbook, because no ID is specified in the input, and defines a Deploy Action step that runs the Threat Response - Quarantine Endpoint Template [Windows] package on the targeted endpoints belonging to the All Windows computer group:

JSON
mutation exampleUpsertPlaybookQuarantineWindows($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_quarantine_windows",
    "description": "Example playbook - Quarantine Windows step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_quarantine_windows_step",
        "description": "Example step 1: Quarantine Windows",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1800
            },
            "completionPercentage": 1,
            "package": {
              "name": "Threat Response - Quarantine Endpoint Template [Windows]",
              "params": [
                "1",
                "1",
                "1",
                "1",
                "1",
                "1",
                "example notification",
                "IN:UDP:10.0.0.21:32:161\nOUT:UDP:10.0.0.21:32:162",
                "192.0.2.10",
                "192.0.2.20",
                "0",
                ""
              ]
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_quarantine_windows",
        "steps": [
          {
            "description": "Example step 1: Quarantine Windows",
            "name": "example_quarantine_windows_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

Create a playbook run from a playbook

(mutation.playbookStart)

The playbookStart mutation requires Automate 1.3 or later and the Automate Playbook execute permission on the content set to which a playbook belongs to start a playbook run.

The following mutation creates a playbook run from a playbook that matches the ID.

JSON
mutation exampleStartPlaybook($id: ID!) {
  playbookStart(input: {id: $id}) {
    playbookRun {
      createdTime
      endTime
      events {
        createdTime
        initiator {
          user {
            displayName
            username
          }
          persona {
            id
          }
        }
        name
      }
      id
      playbook {
        createdTime
        description
        id
        name
        revision
        steps {
          description
          name
        }
        updatedTime
      }
      runAs {
        persona {
          id
        }
        user {
          id
        }
      }
      scheduleStartTime
      startTime
      status
      steps {
        playbookStep {
          description
          name
        }
        status
        error
      }
    }
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the playbook ID variable in the Variables panel or in your variables dictionary:

JSON
{
  "id": "12345678-90ab-cdef-1234-567890abcdef"
}

Example response:

JSON
{
  "data": {
    "playbookStart": {
      "playbookRun": {
        "createdTime": "2023-08-18T19:47:44.041634Z",
        "endTime": null,
        "events": [
          {
            "createdTime": "2023-08-18T12:47:44.0394017-07:00",
            "initiator": {
              "user": {
                "displayName": null,
                "username": "Administrator"
              },
              "persona": null
            },
            "name": "CREATE"
          }
        ],
        "id": "618903ae-a337-40cd-849c-66cb471f5768",
        "playbook": {
          "createdTime": "2023-08-18T19:23:34.008989Z",
          "description": "Example playbook update",
          "id": "12345678-90ab-cdef-1234-567890abcdef",
          "name": "example_playbook_update",
          "revision": 2,
          "steps": [
            {
              "description": "Example step 1 update: Initiation",
              "name": "example_step_1"
            },
            {
              "description": "Example step 2 update: Processing",
              "name": "example_step_2"
            },
            {
              "description": "Example step 3 update: Resolution",
              "name": "example_step_3"
            }
          ],
          "updatedTime": "2023-08-18T19:38:52.458956Z"
        },
        "runAs": {
          "persona": null,
          "user": {
            "id": "1"
          }
        },
        "scheduleStartTime": null,
        "startTime": null,
        "status": "NOT_STARTED",
        "steps": [
          {
            "playbookStep": {
              "description": "Example step 1 update: Initiation",
              "name": "example_step_1"
            },
            "status": "NOT_STARTED",
            "error": ""
          },
          {
            "playbookStep": {
              "description": "Example step 2 update: Processing",
              "name": "example_step_2"
            },
            "status": "NOT_STARTED",
            "error": ""
          },
          {
            "playbookStep": {
              "description": "Example step 3 update: Resolution",
              "name": "example_step_3"
            },
            "status": "NOT_STARTED",
            "error": ""
          }
        ]
      },
      "error": null
    }
  }
}

Get a playbook by ID and version

(query.playbook)

The playbook query requires Automate 1.3 or later and the Automate Playbook read permission on the content set to which a playbook version belongs to retrieve the playbook.

The following query retrieves a playbook based on the ID and playbook version.

JSON
query exampleGetPlaybook($id: ID!, $revision: Int) {
  playbook(ref: {id: $id, revision: $revision}) {
    createdTime
    description
    id
    name
    notificationSettings {
      email {
        events
        recipients
      }
    }
    revision
    startingStep {
      id
      name
      description
    }
    steps {
      id
      description
      name
      taskArgument {
        __typename
      }
    }
    updatedTime
  }
}

Include the playbook ID variable in the Variables panel or in your variables dictionary:

JSON
{
  "id": "12345678-90ab-cdef-1234-567890abcdef",
  "revision": 1
}

Example response:

JSON
{
  "data": {
    "playbook": {
      "createdTime": "2023-08-18T15:53:41.091488Z",
      "description": "example description",
      "id": "12345678-90ab-cdef-1234-567890abcdef",
      "name": "Example playbook",
      "notificationSettings": {
        "email": {
          "events": [
            "START",
            "COMPLETE",
            "END",
            "ERROR",
            "WAIT"
          ],
          "recipients": [
            "username@example.com",
            "username_2@example.com"
          ]
        }
      },
      "revision": 1,
      "startingStep": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "Require User Confirmation",
        "description": "example description"
      },
      "steps": [
        {
          "id": "12345678-90ab-cdef-1234-567890abcdef",
          "description": "example description",
          "name": "Require User Confirmation",
          "taskArgument": {
            "__typename": "AutomateTaskArgumentConfirmation"
          }
        }
      ],
      "updatedTime": "2023-08-18T15:53:41.091488Z"
    }
  }
}

Get a playbook run by ID

(query.playbookRun)

The playbookRun query requires Automate 1.3 or later and the Automate Playbook read permission on the content set to which a playbook belongs to retrieve associated playbook runs.

The following query retrieves a playbook run based on the ID.

JSON
query exampleGetPlaybookRun($id: ID!) {
  playbookRun(ref: {id: $id}) {
    createdTime
    endTime
    events {
      createdTime
      initiator {
        persona {
          id
        }
        user {
          id
        }
      }
      name
    }
    id
    playbook {
      activeRunsCount
      author {
        displayName
        id
        username
      }
      createdTime
      description
      id
      lastModifiedBy {
        displayName
        id
        username
      }
      name
      revision
      steps {
        description
        name
      }
      updatedTime
    }
    runAs {
      persona {
        id
      }
      user {
        id
      }
    }
    scheduleStartTime
    startTime
    status
    steps {
      playbookStep {
        description
        name
        __typename
      }
      status
      error
    }
  }
}

Include the pagination variable in the Variables panel or in your variables dictionary:

JSON
{
  "id": "fedcba09-8765-4321-fedc-ba0987654321"
}

Example response:

JSON
{
  "data": {
    "playbookRun": {
      "createdTime": "2023-08-18T19:49:13.113955Z",
      "endTime": null,
      "events": [
        {
          "createdTime": "2023-08-18T12:49:13.1127798-07:00",
          "initiator": {
            "persona": null,
            "user": {
              "id": "1"
            }
          },
          "name": "CREATE"
        },
        {
          "createdTime": "2023-08-18T19:49:13.1167809Z",
          "initiator": null,
          "name": "START"
        },
        {
          "createdTime": "2023-08-18T19:49:13.1397834Z",
          "initiator": null,
          "name": "WAIT"
        }
      ],
      "id": "fedcba09-8765-4321-fedc-ba0987654321",
      "playbook": {
        "activeRunsCount": 3,
        "author": {
          "displayName": null,
          "id": "1",
          "username": "Administrator"
        },
        "createdTime": "2023-08-18T19:23:34.008989Z",
        "description": "Example playbook update",
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "lastModifiedBy": {
          "displayName": null,
          "id": "1",
          "username": "Administrator"
        },
        "name": "example_playbook_update",
        "revision": 2,
        "steps": [
          {
            "description": "Example step 1 update: Initiation",
            "name": "example_step_1"
          },
          {
            "description": "Example step 2 update: Processing",
            "name": "example_step_2"
          },
          {
            "description": "Example step 3 update: Resolution",
            "name": "example_step_3"
          }
        ],
        "updatedTime": "2023-08-18T19:38:52.458956Z"
      },
      "runAs": {
        "persona": null,
        "user": {
          "id": "1"
        }
      },
      "scheduleStartTime": null,
      "startTime": "2023-08-18T19:49:13.11678Z",
      "status": "WAITING",
      "steps": [
        {
          "playbookStep": {
            "description": "Example step 1 update: Initiation",
            "name": "example_step_1",
            "__typename": "PlaybookStepInstruction"
          },
          "status": "WAITING",
          "error": ""
        },
        {
          "playbookStep": {
            "description": "Example step 2 update: Processing",
            "name": "example_step_2",
            "__typename": "PlaybookStepInstruction"
          },
          "status": "NOT_STARTED",
          "error": ""
        },
        {
          "playbookStep": {
            "description": "Example step 3 update: Resolution",
            "name": "example_step_3",
            "__typename": "PlaybookStepInstruction"
          },
          "status": "NOT_STARTED",
          "error": ""
        }
      ]
    }
  }
}

Get a playbook schedule by ID

(query.playbookSchedule)

The playbookSchedule query requires Automate 1.3 or later and the Automate Playbook read permission on the content set to which a playbook belongs to retrieve associated playbook schedules.

The following query retrieves a playbook schedule based on the ID.

JSON
query exampleGetPlaybookScheduleByID($ref: IdRefInput!) {
  playbookSchedule(ref: $ref) {
    id
    createdTime
    cron
    enabled
    events {
      createdTime
      initiator {
        user {
          id
          displayName
          username
        }
        persona {
          id
        }
      }
      name
    }
    playbook {
      id
      contentSet {
        id
      }
      currentUserHasActiveRun
      description
      name
      revision
    }
    scheduledBy {
      user {
        id
        displayName
        username
      }
      persona {
        id
      }
    }
    updatedTime
  }
}

Include the playbook schedule ID variable in the Variables panel or in your variables dictionary:

JSON
{
  "ref": {
    "id": "12345678-90ab-cdef-1234-567890abcdef"
  }
}

Example response:

JSON
{
  "data": {
    "playbookSchedule": {
      "id": "12345678-90ab-cdef-1234-567890abcdef",
      "createdTime": "2024-04-12T20:37:54.860756Z",
      "cron": "0 0 1 1 1",
      "enabled": true,
      "events": [],
      "playbook": {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "contentSet": {
          "id": "123"
        },
        "currentUserHasActiveRun": false,
        "description": "Example playbook - Scheduling",
        "name": "example_playbook_scheduling",
        "revision": 3
      },
      "scheduledBy": {
        "user": {
          "id": "1",
          "displayName": null,
          "username": "admin"
        },
        "persona": null
      },
      "updatedTime": "2024-04-12T20:37:54.860756Z"
    }
  }
}

Get multiple playbooks

(query.playbooks)

The playbooks query requires Automate 1.3 or later and the Automate Playbook read permission on the content set to which a playbook belongs to retrieve associated playbooks.

Note: Queries that request too many fields or too many results might return a COMPLEXITY_LIMIT_EXCEEDED error code. Reduce the number of fields in the query request, or update pagination to return fewer results.
Note: Querying playbook.canRun might consume a greater amount of resources than querying other fields, and the response might return a COMPLEXITY_LIMIT_EXCEEDED error code. Only include this field in a query request if you limit the number of results returned. Consider using playbook.steps.currentUserMissingPermissions instead to identify whether a user requires additional permissions to run a step, and for increased query efficiency.

The following query retrieves the first two playbooks.

JSON
query exampleGetPlaybooks($first: Int) {
  playbooks(first: $first) {
    edges {
      node {
        createdTime
        description
        id
        name
        notificationSettings {
          email {
            events
            recipients
          }
        }
        revision
        startingStep {
          id
          description
          name
        }
        steps {
          id
          description
          name
          nextStep {
            id
            description
            name
          }
          previousStep {
            id
            description
            name
          }
          taskArgument {
            __typename
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    authorUserIDs
    authorUsers {
      id
      username
      displayName
    }
    contentSetIDs
    contentSets {
      id
      name
      description
    }
    totalRecords
  }
}

Include the pagination variable in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2
}

Example response:

JSON
{
  "data": {
    "playbooks": {
      "edges": [
        {
          "node": {
            "createdTime": "2024-04-09T04:19:05.445776Z",
            "description": "",
            "id": "12345678-90ab-cdef-1234-567890abcdef",
            "name": "example playbook",
            "notificationSettings": {
              "email": {
                "events": [
                  "START",
                  "COMPLETE",
                  "END",
                  "ERROR",
                  "WAIT"
                ],
                "recipients": [
                  "username@example.com",
                  "username_2@example.com"
                ]
              }
            },
            "revision": 1,
            "startingStep": {
              "id": "fedcba09-8765-4321-fedc-ba0987654321",
              "description": "initial step in playbook",
              "name": "example_start_step"
            },
            "steps": [
              {
                "id": "fedcba09-8765-4321-fedc-ba0987654321",
                "description": "initial step in playbook",
                "name": "example_start_step",
                "nextStep": null,
                "previousStep": null,
                "taskArgument": {
                  "__typename": "AutomateTaskArgumentWait"
                }
              }
            ],
            "updatedTime": "2024-04-09T04:19:05.445776Z"
          }
        },
        {
          "node": {
            "createdTime": "2024-04-11T21:12:37.234882Z",
            "description": "",
            "id": "22345678-90ab-cdef-1234-567890abcde2",
            "name": "example playbook 2",
            "notificationSettings": {
              "email": {
                "events": [],
                "recipients": []
              }
            },
            "revision": 1,
            "startingStep": {
              "id": "example-step-id-1",
              "description": "example manual instruction description",
              "name": "Manual Instruction"
            },
            "steps": [
              {
                "id": "example-step-id-1",
                "description": "example manual instruction description",
                "name": "Manual Instruction",
                "nextStep": {
                  "id": "example-step-id-2",
                  "description": "another example manual description",
                  "name": "Manual Instruction - Cloned"
                },
                "previousStep": null,
                "taskArgument": {
                  "__typename": "AutomateTaskArgumentInstruction"
                }
              },
              {
                "id": "example-step-id-2",
                "description": "another example manual description",
                "name": "Manual Instruction - Cloned",
                "nextStep": null,
                "previousStep": {
                  "id": "example-step-id-1",
                  "description": "example manual instruction description",
                  "name": "Manual Instruction"
                },
                "taskArgument": {
                  "__typename": "AutomateTaskArgumentInstruction"
                }
              }
            ],
            "updatedTime": "2024-04-11T21:12:37.234882Z"
          }
        }
      ],
      "pageInfo": {
        "hasPreviousPage": false,
        "hasNextPage": true,
        "startCursor": "eyJpZCI6ImU2Nzg1MmNlLTJkZTMtNDljNi1hYjFhLTM3ZGQ3NTdjZTkwMyIsImNyZWF0ZWRfdGltZSI6IjIwMjQtMDQtMDlUMDQ6MTk6MDUuNDQ1Nzc2WiIsIm5hbWUiOiJBZGFtbyAyIn0K",
        "endCursor": "eyJpZCI6IjEyMzA5NzQ5LWZjMzAtNDcyMi1hZTk4LTU4ZjZjNzA0YzIwYiIsImNyZWF0ZWRfdGltZSI6IjIwMjQtMDQtMTFUMjE6MTI6MzcuMjM0ODgyWiIsIm5hbWUiOiJBZGFtbyAzIn0K"
      },
      "authorUserIDs": [
        "12",
        "23",
        "34"
      ],
      "authorUsers": [
        {
          "id": "12",
          "username": "admin",
          "displayName": null
        },
        {
          "id": "23",
          "username": "example_user_1",
          "displayName": null
        },
        {
          "id": "34",
          "username": "example_user_2",
          "displayName": null
        }
      ],
      "contentSetIDs": [
        "1",
        "1234"
      ],
      "contentSets": [
        {
          "id": "1",
          "name": "Reserved",
          "description": "Built in sensors which can not be edited or removed."
        },
        {
          "id": "1234",
          "name": "Automate",
          "description": "Default content set for Tanium Automate"
        }
      ],
      "totalRecords": 15
    }
  }
}

Get multiple playbook runs

(query.playbookRuns)

The playbookRuns query requires Automate 1.3 or later and the Automate Playbook read permission on the content set to which a playbook version belongs to retrieve associated playbook runs.

Note: Queries that request too many fields or too many results might return a COMPLEXITY_LIMIT_EXCEEDED error code. Reduce the number of fields in the query request, or update pagination to return fewer results.
Note: Querying playbook.canRun might consume a greater amount of resources than querying other fields, and the response might return a COMPLEXITY_LIMIT_EXCEEDED error code. Only include this field in a query request if you limit the number of results returned. Consider using playbook.steps.currentUserMissingPermissions instead to identify whether a user requires additional permissions to run a step, and for increased query efficiency.
Note: If you do not have access to a content set, and a playbook is reassigned to that content set, you cannot retrieve playbook runs started from this playbook version. You can retrieve playbook runs from an earlier playbook version if you have access to the content set containing the earlier playbook version.

The following query retrieves the first two playbook runs.

JSON
query exampleGetPlaybookRuns($first: Int) {
  playbookRuns(first: $first) {
    edges {
      node {
        createdTime
        endTime
        events {
          createdTime
          initiator {
            persona {
              id
            }
            user {
              id
            }
          }
          name
        }
        id
        playbook {
          activeRunsCount
          author {
            id
          }
          createdTime
          description
          id
          lastModifiedBy {
            displayName
            id
            username
          }
          name
          revision
          steps {
            description
            name
          }
          updatedTime
        }
        runAs {
          persona {
            id
          }
          user {
            id
          }
        }
        scheduleStartTime
        startTime
        status
        steps {
          confirmationResult {
            comment
            completedUser {
              id
            }
            completionTime
          }
          playbookStep {
            description
            name
            __typename
          }
          startTime
          status
          error
        }
      }
    }
    initiatorUserIDs
    initiatorUsers {
      id
      username
      displayName
    }
    playbooks {
      playbookID
      playbookName
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the pagination variable in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2
}

Example response:

JSON
{
  "data": {
    "playbookRuns": {
      "edges": [
        {
          "node": {
            "createdTime": "2023-08-18T19:47:44.041634Z",
            "endTime": null,
            "events": [
              {
                "createdTime": "2023-08-18T12:47:44.0394017-07:00",
                "initiator": {
                  "persona": null,
                  "user": {
                    "id": "1"
                  }
                },
                "name": "CREATE"
              },
              {
                "createdTime": "2023-08-18T19:47:44.2224093Z",
                "initiator": null,
                "name": "START"
              },
              {
                "createdTime": "2023-08-18T19:47:44.3544268Z",
                "initiator": null,
                "name": "WAIT"
              }
            ],
            "id": "02345678-90ab-cdef-1234-567890abcde0",
            "playbook": {
              "activeRunsCount": 3,
              "author": {
                "id": "1"
              },
              "createdTime": "2023-08-18T19:23:34.008989Z",
              "description": "Example playbook update",
              "id": "12345678-90ab-cdef-1234-567890abcdef",
              "lastModifiedBy": {
                "displayName": null,
                "id": "1",
                "username": "Administrator"
              },
              "name": "example_playbook_update",
              "revision": 2,
              "steps": [
                {
                  "description": "Example step 1 update: Initiation",
                  "name": "example_step_1"
                },
                {
                  "description": "Example step 2 update: Processing",
                  "name": "example_step_2"
                },
                {
                  "description": "Example step 3 update: Resolution",
                  "name": "example_step_3"
                }
              ],
              "updatedTime": "2023-08-18T19:38:52.458956Z"
            },
            "runAs": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "scheduleStartTime": null,
            "startTime": "2023-08-18T19:47:44.222409Z",
            "status": "WAITING",
            "steps": [
              {
                "confirmationResult": null,
                "playbookStep": {
                  "description": "Example step 1 update: Initiation",
                  "name": "example_step_1",
                  "__typename": "PlaybookStepInstruction"
                },
                "startTime": "2023-08-18T19:47:44.3544268Z",
                "status": "WAITING",
                "error": ""
              },
              {
                "confirmationResult": null,
                "playbookStep": {
                  "description": "Example step 2 update: Processing",
                  "name": "example_step_2",
                  "__typename": "PlaybookStepInstruction"
                },
                "startTime": null,
                "status": "NOT_STARTED",
                "error": ""
              },
              {
                "confirmationResult": null,
                "playbookStep": {
                  "description": "Example step 3 update: Resolution",
                  "name": "example_step_3",
                  "__typename": "PlaybookStepInstruction"
                },
                "startTime": null,
                "status": "NOT_STARTED",
                "error": ""
              }
            ]
          }
        },
        {
          "node": {
            "createdTime": "2023-08-18T19:49:13.113955Z",
            "endTime": null,
            "events": [
              {
                "createdTime": "2023-08-18T12:49:13.1127798-07:00",
                "initiator": {
                  "persona": null,
                  "user": {
                    "id": "1"
                  }
                },
                "name": "CREATE"
              },
              {
                "createdTime": "2023-08-18T19:49:13.1167809Z",
                "initiator": null,
                "name": "START"
              },
              {
                "createdTime": "2023-08-18T19:49:13.1397834Z",
                "initiator": null,
                "name": "WAIT"
              }
            ],
            "id": "22345678-90ab-cdef-1234-567890abcde2",
            "playbook": {
              "activeRunsCount": 3,
              "author": {
                "id": "1"
              },
              "createdTime": "2023-08-18T19:23:34.008989Z",
              "description": "Example playbook update",
              "id": "12345678-90ab-cdef-1234-567890abcdef",
              "lastModifiedBy": {
                "displayName": null,
                "id": "1",
                "username": "Administrator"
              },
              "name": "example_playbook_update",
              "revision": 2,
              "steps": [
                {
                  "description": "Example step 1 update: Initiation",
                  "name": "example_step_1"
                },
                {
                  "description": "Example step 2 update: Processing",
                  "name": "example_step_2"
                },
                {
                  "description": "Example step 3 update: Resolution",
                  "name": "example_step_3"
                }
              ],
              "updatedTime": "2023-08-18T19:38:52.458956Z"
            },
            "runAs": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "scheduleStartTime": null,
            "startTime": "2023-08-18T19:49:13.11678Z",
            "status": "WAITING",
            "steps": [
              {
                "confirmationResult": null,
                "playbookStep": {
                  "description": "Example step 1 update: Initiation",
                  "name": "example_step_1",
                  "__typename": "PlaybookStepInstruction"
                },
                "startTime": "2023-08-18T19:49:13.1397834Z",
                "status": "WAITING",
                "error": ""
              },
              {
                "confirmationResult": null,
                "playbookStep": {
                  "description": "Example step 2 update: Processing",
                  "name": "example_step_2",
                  "__typename": "PlaybookStepInstruction"
                },
                "startTime": null,
                "status": "NOT_STARTED",
                "error": ""
              },
              {
                "confirmationResult": null,
                "playbookStep": {
                  "description": "Example step 3 update: Resolution",
                  "name": "example_step_3",
                  "__typename": "PlaybookStepInstruction"
                },
                "startTime": null,
                "status": "NOT_STARTED",
                "error": ""
              }
            ]
          }
        }
      ],
      "initiatorUserIDs": [
        "123",
        "234"
      ],
      "initiatorUsers": [
        {
          "id": "123",
          "username": "example_user_1",
          "displayName": null
        },
        {
          "id": "234",
          "username": "example_user_2",
          "displayName": null
        }
      ],
      "playbooks": [
        {
          "playbookID": "12345678-90ab-cdef-1234-567890abcdef",
          "playbookName": "example playbook"
        },
        {
          "playbookID": "fedcba09-8765-4321-fedc-ba0987654321",
          "playbookName": "example playbook 2"
        }
      ],
      "pageInfo": {
        "hasPreviousPage": false,
        "hasNextPage": true,
        "startCursor": "eyJpZCI6IjYxODkwM2FlLWEzMzctNDBjZC04NDljLTY2Y2I0NzFmNTc2OCIsImNyZWF0ZWRfdGltZSI6IjIwMjMtMDgtMThUMTk6NDc6NDQuMDQxNjM0WiIsInN0YXR1cyI6IldBSVRJTkcifQo=",
        "endCursor": "eyJpZCI6IjJiM2Q4NTIwLTJjZDktNGY5ZC1iNzdiLWY0ZmFjNWIyOWNlYyIsImNyZWF0ZWRfdGltZSI6IjIwMjMtMDgtMThUMTk6NDk6MTMuMTEzOTU1WiIsInN0YXR1cyI6IldBSVRJTkcifQo="
      },
      "totalRecords": 5
    }
  }
}

Get multiple playbook schedules

(query.playbookSchedules)

The playbookSchedules query requires Automate 1.3 or later and the Automate Playbook read permission on the content set to which a playbook belongs to retrieve associated playbook schedules.

Note: Queries that request too many fields or too many results might return a COMPLEXITY_LIMIT_EXCEEDED error code. Reduce the number of fields in the query request, or update pagination to return fewer results.
Note: Querying playbook.canRun might consume a greater amount of resources than querying other fields, and the response might return a COMPLEXITY_LIMIT_EXCEEDED error code. Only include this field in a query request if you limit the number of results returned. Consider using playbook.steps.currentUserMissingPermissions instead to identify whether a user requires additional permissions to run a step, and for increased query efficiency.

The following query retrieves the first two playbook schedules.

JSON
query exampleGetPlaybookSchedules($first: Int) {
  playbookSchedules(first: $first) {
    edges {
      node {
        id
        createdTime
        cron
        enabled
        events {
          createdTime
          initiator {
            user {
              id
              displayName
              username
            }
            persona {
              id
            }
          }
          name
        }
        playbook {
          id
          contentSet {
            id
          }
          currentUserHasActiveRun
          description
          name
          revision
        }
        scheduledBy {
          user {
            id
            displayName
            username
          }
          persona {
            id
          }
        }
        updatedTime
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    totalRecords
  }
}

Include the pagination variable in the Variables panel or in your variables dictionary:

JSON
{
  "first": 2
}

Example response:

JSON
{
  "data": {
    "playbookSchedules": {
      "edges": [
        {
          "node": {
            "id": "12345678-90ab-cdef-1234-567890abcdef",
            "createdTime": "2024-03-27T14:38:35.620598Z",
            "cron": "38 14 * * *",
            "enabled": false,
            "events": [],
            "playbook": {
              "id": "567890ab-cdef-1234-5678-90abcdef1234",
              "contentSet": {
                "id": "123"
              },
              "currentUserHasActiveRun": false,
              "description": "",
              "name": "Example Playbook - Scheduling",
              "revision": 1
            },
            "scheduledBy": {
              "user": {
                "id": "1",
                "displayName": null,
                "username": "admin"
              },
              "persona": null
            },
            "updatedTime": "2024-03-27T14:38:59.943286Z"
          }
        },
        {
          "node": {
            "id": "fedcba09-8765-4321-fedc-ba0987654321",
            "createdTime": "2024-03-27T14:41:32.91756Z",
            "cron": "41 14 * * *",
            "enabled": false,
            "events": [],
            "playbook": {
              "id": "ba098765-4321-fedc-ba09-87654321fedc",
              "contentSet": {
                "id": "123"
              },
              "currentUserHasActiveRun": false,
              "description": "",
              "name": "Example Playbook - Scheduling 2",
              "revision": 1
            },
            "scheduledBy": {
              "user": {
                "id": "1",
                "displayName": null,
                "username": "admin"
              },
              "persona": null
            },
            "updatedTime": "2024-03-27T14:42:01.149338Z"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": false,
        "startCursor": "eyJJRCI6IjBhYmZhMzEwLTdkMDctNGFkZi05YmYxLWQzNTRlOWQ1ODQ1YiIsIkNyZWF0ZWRUaW1lIjoiMjAyNC0wMy0yN1QxNDozODozNS42MjA1OThaIn0K",
        "endCursor": "eyJJRCI6IjM5MmJkYjIxLWExZGQtNDMxMi04MmRiLTc0NDllNmFhNGZmZiIsIkNyZWF0ZWRUaW1lIjoiMjAyNC0wMy0yN1QxNDo0MTozMi45MTc1NloifQo="
      },
      "totalRecords": 31
    }
  }
}

Upsert (create or update by ID) a playbook

(mutation.playbookUpsert)

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

Depending on the steps you add to a playbook, you might require additional Tanium solutions and permissions.

When you create a playbook, you define one or more steps as input. Each step contains a reference to the next step ID, and the playbook contains a reference to the first step ID. Depending on the step type, you configure one or more of the following:

  • A step name

  • A step description

  • The next step ID

  • The task argument that the step performs

  • Additional information to display to a Tanium user, such as an instruction

  • Question filtering to narrow the targeted endpoints

  • Computer groups or sensors to narrow the targeted endpoints

  • A success percentage of endpoints returned to determine whether to move on to the next step in the playbook run

  • Other configuration specific to the step or task argument functionality

Starting with the second step in the playbook step sequence, you can configure a step to inherit endpoint targeting information from a prior step in the array based on the step ID. Each step evaluation depends on the step task argument functionality, and progression to the next step might depend on evaluating the percentage of endpoints returned, user input, waiting a specified amount of time, or additional success criteria.

Note: Playbooks must have unique names.
Note: Include isNewRecord in your request to determine whether the response created a playbook (isNewRecord equals true) or updated an existing playbook (isNewRecord equals false).

The following mutation creates a playbook, because no ID is specified in the input, and defines several steps:

JSON
mutation examplePlaybookUpsertCreate($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      contentSet {
        name
      }
      createdTime
      description
      id
      name
      startingStep {
        id
        name
        description
      }
      steps {
        id
        description
        name
        nextStep {
          id
          name
          taskArgument {
            __typename
          }
        }
        previousStep {
          id
          name
          taskArgument {
            __typename
          }
        }
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

PYTHON
{
  "input": {
    "name": "example_playbook_upsert_create",
    "description": "Example playbook upsert create",
    "contentSet": {
      "id": "1234"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "12345678-90ab-cdef-1234-567890abcdef",
    "steps": [
      {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_add_tag_windows_step",
        "description": "Example step 1: Add Tags to Windows Machines",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "nextStepID": "22345678-90ab-cdef-1234-567890abcde2",
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1200
            },
            "completionPercentage": 1,
            "package": {
              "id": "35",
              "name": "Custom Tagging - Add Tags",
              "params": [
                "example_tag"
              ]
            }
          }
        }
      },
      {
        "id": "22345678-90ab-cdef-1234-567890abcde2",
        "name": "example_step_2",
        "description": "Example step 2: Verify Windows",
        "nextStepID": "32345678-90ab-cdef-1234-567890abcde3",
        "taskArgument": {
          "instruction": {
            "instruction": "# Process this step, then confirm when complete."
          }
        }
      },
      {
        "id": "32345678-90ab-cdef-1234-567890abcde3",
        "name": "example_remove_tag_windows_step",
        "description": "Example step 3: Remove Tags from Windows Machines",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "nextStepID": null,
        "taskArgument": {
          "deployAction": {
            "actionGroup": {
              "id": "3",
              "name": "Default"
            },
            "actionDuration": {
              "seconds": 1200
            },
            "completionPercentage": 1,
            "package": {
              "id": "37",
              "name": "Custom Tagging - Remove Tags"
            }
          }
        }
      }
    ]
  }
}

Example response if a playbook was created (isNewRecord equals true):

PYTHON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "contentSet": {
          "name": "Automate"
        },
        "createdTime": "2024-08-06T14:26:32.079536Z",
        "description": "Example playbook upsert create",
        "id": "7261c52c-9e3f-427e-a813-0e845f7b89fd",
        "name": "example_playbook_upsert_create",
        "startingStep": {
          "id": "12345678-90ab-cdef-1234-567890abcdef",
          "name": "example_add_tag_windows_step",
          "description": "Example step 1: Add Tags to Windows Machines"
        },
        "steps": [
          {
            "id": "12345678-90ab-cdef-1234-567890abcdef",
            "description": "Example step 1: Add Tags to Windows Machines",
            "name": "example_add_tag_windows_step",
            "nextStep": {
              "id": "22345678-90ab-cdef-1234-567890abcde2",
              "name": "example_step_2",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            },
            "previousStep": null,
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          },
          {
            "id": "22345678-90ab-cdef-1234-567890abcde2",
            "description": "Example step 2: Verify Windows",
            "name": "example_step_2",
            "nextStep": {
              "id": "32345678-90ab-cdef-1234-567890abcde3",
              "name": "example_remove_tag_windows_step",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentDeployAction"
              }
            },
            "previousStep": {
              "id": "12345678-90ab-cdef-1234-567890abcdef",
              "name": "example_add_tag_windows_step",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentDeployAction"
              }
            },
            "taskArgument": {
              "__typename": "AutomateTaskArgumentInstruction"
            }
          },
          {
            "id": "32345678-90ab-cdef-1234-567890abcde3",
            "description": "Example step 3: Remove Tags from Windows Machines",
            "name": "example_remove_tag_windows_step",
            "nextStep": null,
            "previousStep": {
              "id": "22345678-90ab-cdef-1234-567890abcde2",
              "name": "example_step_2",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            },
            "taskArgument": {
              "__typename": "AutomateTaskArgumentDeployAction"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

The following mutation updates an existing playbook with the ID 12345678-90ab-cdef-1234-567890abcdef, and defines three Instruction steps, which display information to an end user:

JSON
mutation examplePlaybookUpsertUpdate($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      contentSet {
        name
      }
      createdTime
      description
      id
      name
      startingStep {
        id
        name
        description
      }
      steps {
        id
        description
        name
        nextStep {
          id
          name
          taskArgument {
            __typename
          }
        }
        previousStep {
          id
          name
          taskArgument {
            __typename
          }
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "fedcba09-8765-4321-fedc-ba0987654321",
    "name": "example_playbook_upsert_create",
    "description": "Example playbook upsert create",
    "contentSet": {
      "id": "1234"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "12345678-90ab-cdef-1234-567890abcdef",
    "steps": [
      {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_step_1",
        "description": "Example step 1: Initiation",
        "nextStepID": "22345678-90ab-cdef-1234-567890abcde2",
        "taskArgument": {
          "instruction": {
            "instruction": "# Initiate (start) this step, then confirm when complete."
          }
        }
      },
      {
        "id": "22345678-90ab-cdef-1234-567890abcde2",
        "name": "example_step_2",
        "description": "Example step 2: Processing",
        "nextStepID": "32345678-90ab-cdef-1234-567890abcde3",
        "taskArgument": {
          "instruction": {
            "instruction": "# Work (Process) this step, then confirm when complete."
          }
        }
      },
      {
        "id": "32345678-90ab-cdef-1234-567890abcde3",
        "name": "example_step_3",
        "description": "Example step 3: Resolution",
        "nextStepID": null,
        "taskArgument": {
          "instruction": {
            "instruction": "# Finish (Resolve) this step, then confirm when complete."
          }
        }
      }
    ]
  }
}

Example response if an existing playbook was updated (isNewRecord equals false):

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "contentSet": {
          "name": "Automate"
        },
        "createdTime": "2024-08-06T14:26:32.079536Z",
        "description": "Example playbook upsert create",
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_playbook_upsert_create",
        "startingStep": {
          "id": "12345678-90ab-cdef-1234-567890abcdef",
          "name": "example_step_1",
          "description": "Example step 1: Initiation"
        },
        "steps": [
          {
            "id": "12345678-90ab-cdef-1234-567890abcdef",
            "description": "Example step 1: Initiation",
            "name": "example_step_1",
            "nextStep": {
              "id": "22345678-90ab-cdef-1234-567890abcde2",
              "name": "example_step_2",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            },
            "previousStep": null
          },
          {
            "id": "22345678-90ab-cdef-1234-567890abcde2",
            "description": "Example step 2: Processing",
            "name": "example_step_2",
            "nextStep": {
              "id": "32345678-90ab-cdef-1234-567890abcde3",
              "name": "example_step_3",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            },
            "previousStep": {
              "id": "12345678-90ab-cdef-1234-567890abcdef",
              "name": "example_step_1",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            }
          },
          {
            "id": "32345678-90ab-cdef-1234-567890abcde3",
            "description": "Example step 3: Resolution",
            "name": "example_step_3",
            "nextStep": null,
            "previousStep": {
              "id": "22345678-90ab-cdef-1234-567890abcde2",
              "name": "example_step_2",
              "taskArgument": {
                "__typename": "AutomateTaskArgumentInstruction"
              }
            }
          }
        ]
      },
      "isNewRecord": false,
      "error": null
    }
  }
}

Upsert (create or update by ID) a playbook schedule

(mutation.playbookScheduleUpsert)

The playbookScheduleUpsert mutation requires Automate 1.3 or later and the Automate Playbook execute permission on the content set to which the associated playbook belongs to create or update a playbook schedule.

Create playbook schedule objects with a reference to a playbook ID to associate a given schedule with the playbook. Playbook runs for this playbook start based on the configured cron expression.

The following mutation creates a playbook schedule, because no playbook schedule ID is specified in the input. This playbook schedule is associated with playbook ID fedcba09-8765-4321-fedc-ba0987654321 and runs using the computer group management permissions of the user and persona submitting the mutation request.

Note: Include isNewRecord in your request to determine whether the response created a playbook schedule (isNewRecord equals true) or updated an existing playbook schedule (isNewRecord equals false).
JSON
mutation examplePlaybookScheduleCreate($input: PlaybookScheduleUpsertInput!) {
  playbookScheduleUpsert(input: $input) {
    playbookSchedule {
      id
      createdTime
      cron
      enabled
      events {
        createdTime
        initiator {
          user {
            id
            displayName
            username
          }
          persona {
            id
          }
        }
        name
      }
      playbook {
        id
        contentSet {
          id
        }
        description
        name
      }
      scheduledBy {
        user {
          id
          displayName
          username
        }
        persona {
          id
        }
      }
      updatedTime
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "playbookID": "fedcba09-8765-4321-fedc-ba0987654321",
    "cron": "0 0 1 1 1",
    "enabled": true
  }
}

Example response if a playbook schedule was created (isNewRecord equals true):

JSON
{
  "data": {
    "playbookScheduleUpsert": {
      "playbookSchedule": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "createdTime": "2024-04-12T19:41:43.118622Z",
        "cron": "0 0 1 1 1",
        "enabled": true,
        "events": [],
        "playbook": {
          "id": "fedcba09-8765-4321-fedc-ba0987654321",
          "contentSet": {
            "id": "123"
          },
          "description": "Example playbook - Scheduling",
          "name": "example_playbook_scheduling"
        },
        "scheduledBy": {
          "user": {
            "id": "1",
            "displayName": null,
            "username": "admin"
          },
          "persona": null
        },
        "updatedTime": "2024-04-12T19:41:43.118622Z"
      },
      "isNewRecord": true,
      "error": null
    }
  }
}

The following mutation updates an existing playbook schedule with the ID 12345678-90ab-cdef-1234-567890abcdef, changing the cron expression:

JSON
mutation examplePlaybookScheduleUpdate($input: PlaybookScheduleUpsertInput!) {
  playbookScheduleUpsert(input: $input) {
    playbookSchedule {
      id
      createdTime
      cron
      enabled
      events {
        createdTime
        initiator {
          user {
            id
            displayName
            username
          }
          persona {
            id
          }
        }
        name
      }
      playbook {
        id
        contentSet {
          id
        }
        description
        name
      }
      scheduledBy {
        user {
          id
          displayName
          username
        }
        persona {
          id
        }
      }
      updatedTime
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "12345678-90ab-cdef-1234-567890abcdef",
    "playbookID": "fedcba09-8765-4321-fedc-ba0987654321",
    "cron": "0 0 1 1 2",
    "enabled": true
  }
}

Example response if an existing playbook schedule was updated (isNewRecord equals false):

JSON
{
  "data": {
    "playbookScheduleUpsert": {
      "playbookSchedule": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "createdTime": "2024-04-12T19:41:43.118622Z",
        "cron": "0 0 1 1 2",
        "enabled": true,
        "events": [],
        "playbook": {
          "id": "fedcba09-8765-4321-fedc-ba0987654321",
          "contentSet": {
            "id": "123"
          },
          "description": "Example playbook - Scheduling",
          "name": "example_playbook_scheduling"
        },
        "scheduledBy": {
          "user": {
            "id": "1",
            "displayName": null,
            "username": "admin"
          },
          "persona": null
        },
        "updatedTime": "2024-04-12T19:41:43.118622Z"
      },
      "isNewRecord": false,
      "error": null
    }
  }
}

Delete a playbook

(mutation.playbookPerformOperation)

Stability: 1.2 - Experimental (Release Candidate)

The playbookPerformOperation mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to perform the delete operation on associated playbooks.

The following mutation performs the DELETE operation on the playbook that matches the ID. This deletes the playbook and future-scheduled playbook runs associated with the playbook, but does not delete in-progress playbook runs associated with the playbook.

Note: The PlaybookOperation object enumerates available playbook operations.
JSON
mutation exampleDeletePlaybook($id: ID!, $operation: PlaybookOperation!) {
  playbookPerformOperation(input: {id: $id, operation: $operation}) {
    playbook {
      activeRunsCount
      author {
        displayName
        id
        username
      }
      createdTime
      description
      id
      lastModifiedBy {
        displayName
        id
        username
      }
      name
      revision
      runs {
        edges {
          node {
            createdTime
            endTime
            events {
              createdTime
              name
              initiator {
                user {
                  displayName
                  id
                  username
                }
                persona {
                  id
                }
              }
            }
            id
            playbook {
              id
            }
            runAs {
              user {
                displayName
                id
                username
              }
              persona {
                id
              }
            }
            scheduleStartTime
            startTime
            status
            steps {
              error
              startTime
              endTime
            }
          }
        }
      }
      steps {
        description
        name
      }
      updatedTime
    }
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "id": "12345678-90ab-cdef-1234-567890abcdef",
  "operation": "DELETE"
}

Example response:

JSON
{
  "data": {
    "playbookPerformOperation": {
      "playbook": {
        "activeRunsCount": 3,
        "author": {
          "displayName": null,
          "id": "1",
          "username": "Administrator"
        },
        "createdTime": "2023-08-18T19:23:34.008989Z",
        "description": "Example playbook update",
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "lastModifiedBy": {
          "displayName": null,
          "id": "1",
          "username": "Administrator"
        },
        "name": "example_playbook_update",
        "revision": 3,
        "runs": {
          "edges": [
            {
              "node": {
                "createdTime": "2023-08-18T19:47:44.041634Z",
                "endTime": null,
                "events": [
                  {
                    "createdTime": "2023-08-18T12:47:44.0394017-07:00",
                    "name": "CREATE",
                    "initiator": {
                      "user": {
                        "displayName": null,
                        "id": "1",
                        "username": "Administrator"
                      },
                      "persona": null
                    }
                  },
                  {
                    "createdTime": "2023-08-18T19:47:44.2224093Z",
                    "name": "START",
                    "initiator": null
                  },
                  {
                    "createdTime": "2023-08-18T19:47:44.3544268Z",
                    "name": "WAIT",
                    "initiator": null
                  }
                ],
                "id": "fedcba09-8765-4321-fedc-ba0987654321",
                "playbook": {
                  "id": "12345678-90ab-cdef-1234-567890abcdef"
                },
                "runAs": {
                  "user": {
                    "displayName": null,
                    "id": "1",
                    "username": "Administrator"
                  },
                  "persona": null
                },
                "scheduleStartTime": null,
                "startTime": "2023-08-18T19:47:44.222409Z",
                "status": "WAITING",
                "steps": [
                  {
                    "error": "",
                    "startTime": "2023-08-18T19:47:44.3544268Z",
                    "endTime": null
                  },
                  {
                    "error": "",
                    "startTime": null,
                    "endTime": null
                  },
                  {
                    "error": "",
                    "startTime": null,
                    "endTime": null
                  }
                ]
              }
            },
            {
              "node": {
                "createdTime": "2023-08-18T19:49:13.113955Z",
                "endTime": null,
                "events": [
                  {
                    "createdTime": "2023-08-18T12:49:13.1127798-07:00",
                    "name": "CREATE",
                    "initiator": {
                      "user": {
                        "displayName": null,
                        "id": "1",
                        "username": "Administrator"
                      },
                      "persona": null
                    }
                  },
                  {
                    "createdTime": "2023-08-18T19:49:13.1167809Z",
                    "name": "START",
                    "initiator": null
                  },
                  {
                    "createdTime": "2023-08-18T19:49:13.1397834Z",
                    "name": "WAIT",
                    "initiator": null
                  }
                ],
                "id": "eedcba09-8765-4321-fedc-ba098765432e",
                "playbook": {
                  "id": "12345678-90ab-cdef-1234-567890abcdef"
                },
                "runAs": {
                  "user": {
                    "displayName": null,
                    "id": "1",
                    "username": "Administrator"
                  },
                  "persona": null
                },
                "scheduleStartTime": null,
                "startTime": "2023-08-18T19:49:13.11678Z",
                "status": "WAITING",
                "steps": [
                  {
                    "error": "",
                    "startTime": "2023-08-18T19:49:13.1397834Z",
                    "endTime": null
                  },
                  {
                    "error": "",
                    "startTime": null,
                    "endTime": null
                  },
                  {
                    "error": "",
                    "startTime": null,
                    "endTime": null
                  }
                ]
              }
            },
            {
              "node": {
                "createdTime": "2023-08-18T19:49:17.873797Z",
                "endTime": null,
                "events": [
                  {
                    "createdTime": "2023-08-18T12:49:17.8731032-07:00",
                    "name": "CREATE",
                    "initiator": {
                      "user": {
                        "displayName": null,
                        "id": "1",
                        "username": "Administrator"
                      },
                      "persona": null
                    }
                  },
                  {
                    "createdTime": "2023-08-18T19:49:18.1610911Z",
                    "name": "START",
                    "initiator": null
                  },
                  {
                    "createdTime": "2023-08-18T19:49:18.2150748Z",
                    "name": "WAIT",
                    "initiator": null
                  }
                ],
                "id": "dedcba09-8765-4321-fedc-ba098765432d",
                "playbook": {
                  "id": "12345678-90ab-cdef-1234-567890abcdef"
                },
                "runAs": {
                  "user": {
                    "displayName": null,
                    "id": "1",
                    "username": "Administrator"
                  },
                  "persona": null
                },
                "scheduleStartTime": null,
                "startTime": "2023-08-18T19:49:18.161091Z",
                "status": "WAITING",
                "steps": [
                  {
                    "error": "",
                    "startTime": "2023-08-18T19:49:18.2150748Z",
                    "endTime": null
                  },
                  {
                    "error": "",
                    "startTime": null,
                    "endTime": null
                  },
                  {
                    "error": "",
                    "startTime": null,
                    "endTime": null
                  }
                ]
              }
            }
          ]
        },
        "steps": [
          {
            "description": "Example step 1 update: Initiation",
            "name": "example_step_1"
          },
          {
            "description": "Example step 2 update: Processing",
            "name": "example_step_2"
          },
          {
            "description": "Example step 3 update: Resolution",
            "name": "example_step_3"
          }
        ],
        "updatedTime": "2023-08-18T20:46:48.99018Z"
      },
      "error": null
    }
  }
}

Delete a playbook schedule

(mutation.playbookSchedulePerformOperation)

Stability: 1.2 - Experimental (Release Candidate)

The playbookSchedulePerformOperation mutation requires Automate 1.3 or later and:

  • the Automate Playbook execute permission on the content set to which the associated playbook belongs, if you created the playbook schedule with your currently active persona, or

  • the Automate Playbook write permission on the content set to which the associated playbook belongs, if another user created the playbook schedule, or you created the playbook schedule with a different persona than your currently active persona

The following mutation performs the DELETE operation on the playbook schedule that matches the ID. This deletes a playbook schedule.

Note: The PlaybookScheduleOperation object enumerates available playbook schedule operations.
JSON
mutation exampleDeletePlaybookScheduleOperation($input: PlaybookSchedulePerformOperationInput!) {
  playbookSchedulePerformOperation(input: $input) {
    playbookSchedule {
      id
      createdTime
      cron
      enabled
      events {
        createdTime
        initiator {
          user {
            id
            displayName
            username
          }
          persona {
            id
          }
        }
        name
      }
      playbook {
        id
        description
        name
      }
      scheduledBy {
        user {
          id
          displayName
          username
        }
        persona {
          id
        }
      }
      updatedTime
    }
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "12345678-90ab-cdef-1234-567890abcdef",
    "operation": "DELETE"
  }
}

Example response:

JSON
{
  "data": {
    "playbookSchedulePerformOperation": {
      "playbookSchedule": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "createdTime": "2024-04-12T19:41:43.118622Z",
        "cron": "0 0 1 1 1",
        "enabled": true,
        "events": [],
        "playbook": {
          "id": "fedcba09-8765-4321-fedc-ba0987654321",
          "description": "Example playbook - Scheduling",
          "name": "example_playbook_scheduling"
        },
        "scheduledBy": {
          "user": {
            "id": "1",
            "displayName": null,
            "username": "admin"
          },
          "persona": null
        },
        "updatedTime": "2024-04-12T20:13:30.603601Z"
      },
      "error": null
    }
  }
}

Disable an enabled playbook schedule

(mutation.playbookSchedulePerformOperation)

Stability: 1.2 - Experimental (Release Candidate)

The playbookSchedulePerformOperation mutation requires Automate 1.3 or later and:

  • the Automate Playbook execute or Automate Playbook write permission on the content set to which the associated playbook belongs, if you created the playbook schedule with your currently active persona, or

  • the Automate Playbook write permission on the content set to which the associated playbook belongs, if another user created the playbook schedule, or you created the playbook schedule with a different persona than your currently active persona

The following mutation performs the DISABLE operation on the playbook schedule that matches the ID. This disables an enabled playbook schedule. No playbook runs are started from disabled playbook schedules. This has no effect on disabled playbook schedules.

Note: The PlaybookScheduleOperation object enumerates available playbook schedule operations.
JSON
mutation exampleDisablePlaybookScheduleOperation($input: PlaybookSchedulePerformOperationInput!) {
  playbookSchedulePerformOperation(input: $input) {
    playbookSchedule {
      id
      createdTime
      cron
      enabled
      events {
        createdTime
        initiator {
          user {
            id
            displayName
            username
          }
          persona {
            id
          }
        }
        name
      }
      playbook {
        id
        description
        name
      }
      scheduledBy {
        user {
          id
          displayName
          username
        }
        persona {
          id
        }
      }
      updatedTime
    }
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "12345678-90ab-cdef-1234-567890abcdef",
    "operation": "DISABLE"
  }
}

Example response:

JSON
{
  "data": {
    "playbookSchedulePerformOperation": {
      "playbookSchedule": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "createdTime": "2024-04-12T19:41:43.118622Z",
        "cron": "0 0 1 1 1",
        "enabled": false,
        "events": [
          {
            "createdTime": "2024-12-03T19:17:14.056452452Z",
            "initiator": {
              "user": {
                "id": "1",
                "displayName": null,
                "username": "admin"
              },
              "persona": null
            },
            "name": "DISABLED_BY_USER"
          }
        ],
        "playbook": {
          "id": "fedcba09-8765-4321-fedc-ba0987654321",
          "description": "Example playbook - Scheduling",
          "name": "example_playbook_scheduling"
        },
        "scheduledBy": {
          "user": {
            "id": "1",
            "displayName": null,
            "username": "admin"
          },
          "persona": null
        },
        "updatedTime": "2024-04-12T20:13:30.603601Z"
      },
      "error": null
    }
  }
}

Enable a disabled playbook schedule

(mutation.playbookSchedulePerformOperation)

Stability: 1.2 - Experimental (Release Candidate)

The playbookSchedulePerformOperation mutation requires Automate 1.3 or later and:

  • the Automate Playbook execute permission on the content set to which the associated playbook belongs, if you created the playbook schedule with your currently active persona

The following mutation performs the ENABLE operation on the playbook schedule that matches the ID. This enables a disabled playbook schedule. This has no effect on enabled playbook schedules.

Note: The PlaybookScheduleOperation object enumerates available playbook schedule operations.
JSON
mutation exampleEnablePlaybookScheduleOperation($input: PlaybookSchedulePerformOperationInput!) {
  playbookSchedulePerformOperation(input: $input) {
    playbookSchedule {
      id
      createdTime
      cron
      enabled
      events {
        createdTime
        initiator {
          user {
            id
            displayName
            username
          }
          persona {
            id
          }
        }
        name
      }
      playbook {
        id
        description
        name
      }
      scheduledBy {
        user {
          id
          displayName
          username
        }
        persona {
          id
        }
      }
      updatedTime
    }
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "12345678-90ab-cdef-1234-567890abcdef",
    "operation": "ENABLE"
  }
}

Example response:

JSON
{
  "data": {
    "playbookSchedulePerformOperation": {
      "playbookSchedule": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "createdTime": "2024-04-12T19:41:43.118622Z",
        "cron": "0 0 1 1 1",
        "enabled": true,
        "events": [
          {
            "createdTime": "2024-12-03T19:17:14.056452452Z",
            "initiator": {
              "user": {
                "id": "1",
                "displayName": null,
                "username": "admin"
              },
              "persona": null
            },
            "name": "DISABLED_BY_USER"
          }
        ],
        "playbook": {
          "id": "fedcba09-8765-4321-fedc-ba0987654321",
          "description": "Example playbook - Scheduling",
          "name": "example_playbook_scheduling"
        },
        "scheduledBy": {
          "user": {
            "id": "1",
            "displayName": null,
            "username": "admin"
          },
          "persona": null
        },
        "updatedTime": "2024-04-12T20:13:30.603601Z"
      },
      "error": null
    }
  }
}

End a playbook run

(mutation.playbookRunPerformOperation)

Stability: 1.2 - Experimental (Release Candidate)

The playbookRunPerformOperation mutation requires Automate 1.3 or later and the Automate Playbook execute permission on the playbook content set.

Note: To end a playbook run, you must have the same permissions as required to run the playbook.

The following mutation performs the END operation on the playbook run that matches the ID. This ends a playbook run.

Note: The PlaybookRunOperation object enumerates available playbook run operations.
JSON
mutation exampleEndPlaybookRunOperation($input: PlaybookRunPerformOperationInput!) {
  playbookRunPerformOperation(
    input: $input
  ) {
    playbookRun {
      createdTime
      endTime
      events {
        createdTime
        initiator {
          persona {
            id
          }
          user {
            id
          }
        }
        name
      }
      id
      playbook {
        id
      }
      runAs {
        persona {
          id
        }
        user {
          id
        }
      }
      scheduleStartTime
      startTime
      status
      steps {
        confirmationResult {
          comment
          completedUser {
            id
          }
          completionTime
        }
        endTime
        playbookStep {
          description
          name
        }
        startTime
        status
        error
      }
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "fedcba09-8765-4321-fedc-ba0987654321",
    "operation": "END"
  }
}

Example response:

JSON
{
  "data": {
    "playbookRunPerformOperation": {
      "playbookRun": {
        "createdTime": "2023-08-18T19:49:13.113955Z",
        "endTime": null,
        "events": [
          {
            "createdTime": "2023-08-18T12:49:13.1127798-07:00",
            "initiator": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "name": "CREATE"
          },
          {
            "createdTime": "2023-08-18T19:49:13.1167809Z",
            "initiator": null,
            "name": "START"
          },
          {
            "createdTime": "2023-08-18T19:49:13.1397834Z",
            "initiator": null,
            "name": "WAIT"
          }
        ],
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "playbook": {
          "id": "12345678-90ab-cdef-1234-567890abcdef"
        },
        "runAs": {
          "persona": null,
          "user": {
            "id": "1"
          }
        },
        "scheduleStartTime": null,
        "startTime": "2023-08-18T19:49:13.11678Z",
        "status": "ENDING",
        "steps": [
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 1 update: Initiation",
              "name": "example_step_1"
            },
            "startTime": "2023-08-18T19:49:13.1397834Z",
            "status": "WAITING",
            "error": ""
          },
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 2 update: Processing",
              "name": "example_step_2"
            },
            "startTime": null,
            "status": "NOT_STARTED",
            "error": ""
          },
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 3 update: Resolution",
              "name": "example_step_3"
            },
            "startTime": null,
            "status": "NOT_STARTED",
            "error": ""
          }
        ]
      }
    }
  }
}

Pause a running playbook run

(mutation.playbookRunPerformOperation)

Stability: 1.2 - Experimental (Release Candidate)

The playbookRunPerformOperation mutation requires Automate 1.3 or later and the Automate Playbook execute permission on the playbook content set.

Note: To pause a playbook run, you must have the same permissions as required to run the playbook.

The following mutation performs the PAUSE operation on the playbook run that matches the ID. This pauses a running playbook run.

Note: The PlaybookRunOperation object enumerates available playbook run operations.
JSON
mutation examplePausePlaybookRunOperation($input: PlaybookRunPerformOperationInput!) {
  playbookRunPerformOperation(
    input: $input
  ) {
    playbookRun {
      createdTime
      endTime
      events {
        createdTime
        initiator {
          persona {
            id
          }
          user {
            id
          }
        }
        name
      }
      id
      playbook {
        id
      }
      runAs {
        persona {
          id
        }
        user {
          id
        }
      }
      scheduleStartTime
      startTime
      status
      steps {
        confirmationResult {
          comment
          completedUser {
            id
          }
          completionTime
        }
        endTime
        playbookStep {
          description
          name
        }
        startTime
        status
        error
      }
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "fedcba09-8765-4321-fedc-ba0987654321",
    "operation": "PAUSE"
  }
}

Example response:

JSON
{
  "data": {
    "playbookRunPerformOperation": {
      "playbookRun": {
        "createdTime": "2023-08-18T19:49:13.113955Z",
        "endTime": null,
        "events": [
          {
            "createdTime": "2023-08-18T12:49:13.1127798-07:00",
            "initiator": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "name": "CREATE"
          },
          {
            "createdTime": "2023-08-18T19:49:13.1167809Z",
            "initiator": null,
            "name": "START"
          },
          {
            "createdTime": "2023-08-18T19:49:13.1397834Z",
            "initiator": null,
            "name": "WAIT"
          }
        ],
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "playbook": {
          "id": "12345678-90ab-cdef-1234-567890abcdef"
        },
        "runAs": {
          "persona": null,
          "user": {
            "id": "1"
          }
        },
        "scheduleStartTime": null,
        "startTime": "2023-08-18T19:49:13.11678Z",
        "status": "PAUSING",
        "steps": [
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 1 update: Initiation",
              "name": "example_step_1"
            },
            "startTime": "2023-08-18T19:49:13.1397834Z",
            "status": "WAITING",
            "error": ""
          },
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 2 update: Processing",
              "name": "example_step_2"
            },
            "startTime": null,
            "status": "NOT_STARTED",
            "error": ""
          },
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 3 update: Resolution",
              "name": "example_step_3"
            },
            "startTime": null,
            "status": "NOT_STARTED",
            "error": ""
          }
        ]
      }
    }
  }
}

Resume a paused playbook run

(mutation.playbookRunPerformOperation)

Stability: 1.2 - Experimental (Release Candidate)

The playbookRunPerformOperation mutation requires Automate 1.3 or later and the Automate Playbook execute permission on the playbook content set.

Note: To resume a playbook run, you must have the same permissions as required to run the playbook.

The following mutation performs the RESUME operation on the playbook run that matches the ID. This resumes a paused playbook run.

Note: The PlaybookRunOperation object enumerates available playbook run operations.
JSON
mutation exampleResumePlaybookRunOperation($input: PlaybookRunPerformOperationInput!) {
  playbookRunPerformOperation(
    input: $input
  ) {
    playbookRun {
      createdTime
      endTime
      events {
        createdTime
        initiator {
          persona {
            id
          }
          user {
            id
          }
        }
        name
      }
      id
      playbook {
        id
      }
      runAs {
        persona {
          id
        }
        user {
          id
        }
      }
      scheduleStartTime
      startTime
      status
      steps {
        confirmationResult {
          comment
          completedUser {
            id
          }
          completionTime
        }
        endTime
        playbookStep {
          description
          name
        }
        startTime
        status
        error
      }
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "fedcba09-8765-4321-fedc-ba0987654321",
    "operation": "RESUME"
  }
}

Example response:

JSON
{
  "data": {
    "playbookRunPerformOperation": {
      "playbookRun": {
        "createdTime": "2023-08-18T19:49:13.113955Z",
        "endTime": null,
        "events": [
          {
            "createdTime": "2023-08-18T12:49:13.1127798-07:00",
            "initiator": {
              "persona": null,
              "user": {
                "id": "1"
              }
            },
            "name": "CREATE"
          },
          {
            "createdTime": "2023-08-18T19:49:13.1167809Z",
            "initiator": null,
            "name": "START"
          },
          {
            "createdTime": "2023-08-18T19:49:13.1397834Z",
            "initiator": null,
            "name": "WAIT"
          }
        ],
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "playbook": {
          "id": "12345678-90ab-cdef-1234-567890abcdef"
        },
        "runAs": {
          "persona": null,
          "user": {
            "id": "1"
          }
        },
        "scheduleStartTime": null,
        "startTime": "2023-08-18T19:49:13.11678Z",
        "status": "RESUMING",
        "steps": [
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 1 update: Initiation",
              "name": "example_step_1"
            },
            "startTime": "2023-08-18T19:49:13.1397834Z",
            "status": "WAITING",
            "error": ""
          },
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 2 update: Processing",
              "name": "example_step_2"
            },
            "startTime": null,
            "status": "NOT_STARTED",
            "error": ""
          },
          {
            "confirmationResult": null,
            "endTime": null,
            "playbookStep": {
              "description": "Example step 3 update: Resolution",
              "name": "example_step_3"
            },
            "startTime": null,
            "status": "NOT_STARTED",
            "error": ""
          }
        ]
      }
    }
  }
}

Update playbook content set membership

(mutation.playbookContentSetUpdate)

Stability: 1.2 - Experimental (Release Candidate)

The playbookContentSetUpdate mutation requires Automate 1.5 or later and the Automate Playbook write permission on the playbook content set to update a playbook content set membership.

The following mutation updates the playbook with the ID 12345678-90ab-cdef-1234-567890abcdef to belong to the content set with the ID 2:

JSON
mutation exampleChangePlaybookContentSet($input: PlaybookContentSetUpdateInput!) {
  playbookContentSetUpdate(input: $input) {
    playbook {
      id
      name
      contentSet {
        id
        name
        description
      }
      description
      updatedTime
    }
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "id": "12345678-90ab-cdef-1234-567890abcdef",
    "contentSet": {
      "id": "2"
    }
  }
}

Example response:

JSON
{
  "data": {
    "playbookContentSetUpdate": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example playbook content set update",
        "contentSet": {
          "id": "2",
          "name": "Default",
          "description": null
        },
        "description": "example description",
        "updatedTime": "2024-11-15T20:07:29.166156Z"
      },
      "error": null
    }
  }
}

Add Install Patch step to a playbook

(mutation.upsertPlaybook (input.steps))

Stability: 1.1 - Experimental (Active Development)

The playbookUpsert mutation requires Automate 1.3 or later and the Automate Playbook write permission on the playbook content set to create or update a playbook.

The Install Patch step requires Patch 3.16.191 or later and the following permissions:

  • Computer Group read permission

  • Patch Deployment execute permission

  • Patch Deployment write permission

  • Sensor read permission

Depending on the deployment, the Install Patch step might require additional Patch permissions.

The Install Patch step deploys a patch to targeted endpoints. The Install Patch step always creates a one-time deployment. The patch content download and patch deployment both start when the Install Patch step starts. You cannot configure an Install Patch step to create an ongoing patch deployment, configure a start time or end time, or configure patch content downloaded to endpoints prior to the patch deployment start.

Note: The Install Patch step does not support uploading title icons or body images for end user notifications.

The following mutation creates a playbook, because no ID is specified in the input, and defines an Install Patch step that deploys a Windows patch on the targeted endpoints belonging to the All Windows computer group:

JSON
mutation exampleUpsertPlaybookInstallPatch($input: PlaybookUpsertInput!) {
  playbookUpsert(input: $input) {
    playbook {
      id
      name
      steps {
        description
        name
        taskArgument {
          __typename
        }
      }
    }
    isNewRecord
    error {
      message
      retryable
      timedOut
    }
  }
}

Include the input variables in the Variables panel or in your variables dictionary:

JSON
{
  "input": {
    "name": "example_playbook_install_patch",
    "description": "Example playbook - Install Patch step",
    "contentSet": {
      "id": "123"
    },
    "notificationSettings": {
      "email": {
        "events": [
          "START",
          "END"
        ],
        "recipients": [
          "host@example.com"
        ]
      }
    },
    "startingStepID": "fedcba09-8765-4321-fedc-ba0987654321",
    "steps": [
      {
        "id": "fedcba09-8765-4321-fedc-ba0987654321",
        "name": "example_install_patch_step",
        "description": "Example step 1: Install Patch on Windows endpoints",
        "endpointTargeting": {
          "customTargeting": {
            "memberOf": {
              "name": "All Windows"
            },
            "negated": false,
            "any": true
          }
        },
        "taskArgument": {
          "patchInstallDeployment": {
            "completionPercentage": 1,
            "patchDeploymentConfig": {
              "contentDeploymentType": "MANUAL_SELECTION",
              "contentSet": {
                "id": "1"
              },
              "description": "example Patch deployment for Windows",
              "distributeOver": {
                "seconds": 900
              },
              "eussHideFromActivity": false,
              "name": "example_deployment_windows",
              "overrideBlocklists": false,
              "overrideMaintenanceWindows": false,
              "patches": [],
              "patchLists": [
                {
                  "id": "12",
                  "version": null
                }
              ],
              "platform": "WINDOWS",
              "postDeploymentNotification": {
                "body": "Example body",
                "countdownToDeadline": {
                  "seconds": 600
                },
                "includeFrame": false,
                "notificationPeriodDuration": {
                  "seconds": 7200
                },
                "postponeOptions": {
                  "durationOne": {
                    "seconds": 1800
                  },
                  "durationTwo": {
                    "seconds": 1200
                  },
                  "durationThree": {
                    "seconds": 600
                  }
                },
                "title": "Example title",
                "translations": [
                  {
                    "body": "ejemplo",
                    "languageCode": "es",
                    "title": "ejemplo"
                  }
                ]
              },
              "restart": true
            },
            "deploymentDuration": {
              "nanoseconds": 0,
              "seconds": 86400
            },
            "skipVerification": false
          }
        }
      }
    ]
  }
}

Example response:

JSON
{
  "data": {
    "playbookUpsert": {
      "playbook": {
        "id": "12345678-90ab-cdef-1234-567890abcdef",
        "name": "example_playbook_install_patch",
        "steps": [
          {
            "description": "Example step 1: Install Patch on Windows endpoints",
            "name": "example_install_patch_step",
            "taskArgument": {
              "__typename": "AutomateTaskArgumentPatchInstallDeployment"
            }
          }
        ]
      },
      "isNewRecord": true,
      "error": null
    }
  }
}