Skip to content
LogoLogo

Action schema

See Management API schema for every domain, the endpoint and authentication.

Queries

action

Reads an action. Scope: ORGANIZATION_WORKSPACE_READ.

action(id: ID!, workspaceId: ID!): Action @auth

actions

Lists the actions in a workspace. search matches a case-insensitive substring of the name; sortKey and reverse set the order. Scope: ORGANIZATION_WORKSPACE_READ.

actions(first: Int, after: String, last: Int, before: String, workspaceId: ID!, search: String, sortKey: ActionSortKeys = NAME, reverse: Boolean = false): ActionConnection! @auth

Mutations

actionCreate

Creates an action in a workspace. Scope: ORGANIZATION_WORKSPACE_UPDATE.

actionCreate(input: ActionCreateInput!): ActionCreatePayload! @auth

actionUpdate

Updates an action. Scope: ORGANIZATION_WORKSPACE_UPDATE.

actionUpdate(input: ActionUpdateInput!): ActionUpdatePayload! @auth

actionDelete

Deletes an action and the workflow it starts. An action that an experience references is not deleted, and comes back as an IN_USE user error. Scope: ORGANIZATION_WORKSPACE_UPDATE.

actionDelete(input: ActionDeleteInput!): ActionDeletePayload! @auth

Types

Action

"""
A side effect that starts when a flow reaches it. Your application registers a handler for it by
`key`.
"""
type Action {
  """The ID of the action."""
  id: ID!
  """The name of the action."""
  name: String!
  """The stable identifier of the action, unique within its workspace."""
  key: String!
  """A description of the action. Null when none is set."""
  description: String
  """When the action was created."""
  createdAt: DateTime!
  """When the action last changed."""
  updatedAt: DateTime!
  """The workspace the action belongs to."""
  workspace: Workspace!
  """The ID of the workspace the action belongs to."""
  workspaceId: ID
  """The fields whose answers the action receives."""
  fields(first: Int, after: String, last: Int, before: String): FieldConnection!
  """The workflow the action starts. Null when it starts none."""
  workflow: Workflow
  """
  The field the action's resolved value is stored in. Null when none is set.
  """
  successField: Field
  """
  The field the action's failure, `{ code, message }`, is stored in. Null when none is set.
  """
  failureField: Field
}

ActionConnection

"""A page of actions."""
type ActionConnection {
  """The edges in this page."""
  edges: [ActionEdge!]!
  """The actions in this page."""
  nodes: [Action!]!
  """Where this page sits in the list."""
  pageInfo: PageInfo!
  """The number of actions across all pages, ignoring `search`."""
  totalCount: Int!
}

ActionEdge

"""An action in a page of results."""
type ActionEdge {
  """The cursor of this edge."""
  cursor: String!
  """The action."""
  node: Action!
}

ActionCreateInput

"""The input of `actionCreate`."""
input ActionCreateInput {
  """The ID of the workspace to create the action in."""
  workspaceId: ID!
  """The name of the action."""
  name: String!
  """
  The stable identifier of the action, unique within the workspace. It cannot change later.
  """
  key: String!
  """A description of the action."""
  description: String
  """The IDs of the fields whose answers the action receives."""
  fieldIds: [ID!]
  """The ID of the field the action's resolved value is stored in."""
  successFieldId: ID
  """
  The ID of the field the action's failure, `{ code, message }`, is stored in.
  """
  failureFieldId: ID
}

ActionCreatePayload

"""The result of `actionCreate`."""
type ActionCreatePayload {
  """The created action."""
  action: Action
}

ActionUpdateInput

"""The input of `actionUpdate`. Omit a field to keep its value."""
input ActionUpdateInput {
  """The ID of the action."""
  id: ID!
  """The ID of the workspace the action belongs to."""
  workspaceId: ID!
  """The name of the action."""
  name: String
  """A description of the action."""
  description: String
  """
  The IDs of the fields whose answers the action receives. Replaces the current set; an empty list clears it.
  """
  fieldIds: [ID!]
  """
  The ID of the field the action's resolved value is stored in. `null` clears it.
  """
  successFieldId: ID
  """
  The ID of the field the action's failure, `{ code, message }`, is stored in. `null` clears it.
  """
  failureFieldId: ID
}

ActionUpdatePayload

"""The result of `actionUpdate`."""
type ActionUpdatePayload {
  """The updated action."""
  action: Action
}

ActionDeleteInput

"""The input of `actionDelete`."""
input ActionDeleteInput {
  """The ID of the action."""
  id: ID!
  """The ID of the workspace the action belongs to."""
  workspaceId: ID!
}

ActionDeletePayload

"""The result of `actionDelete`."""
type ActionDeletePayload {
  """The ID of the deleted action. Null when `userErrors` is not empty."""
  deletedActionId: ID
  """The reasons the action was not deleted. Empty on success."""
  userErrors: [ActionDeleteUserError!]!
}

ActionDeleteUserErrorCode

"""The reasons `actionDelete` refuses a delete."""
enum ActionDeleteUserErrorCode {
  """An experience references the action."""
  IN_USE
}

ActionDeleteUserError

"""A reason `actionDelete` did not delete an action."""
type ActionDeleteUserError {
  """
  The path to the input field at fault. Null when no single field is at fault.
  """
  field: [String!]
  """A message to show the user."""
  message: String!
  """A machine-readable code."""
  code: ActionDeleteUserErrorCode!
  """
  The experiences that reference the action. Null unless `code` is `IN_USE`.
  """
  referencingExperiences: [ReferencingExperience!]
}

ActionSortKeys

"""The orders `actions` can sort by. `reverse: true` flips each."""
enum ActionSortKeys {
  """By name, A to Z."""
  NAME
  """By creation time, oldest first."""
  CREATED_AT
  """By last change, oldest first."""
  UPDATED_AT
}