Create Automation

Create a new automation with a trigger and one or more actions


Create Automation

Create a new automation workflow for your project. An automation consists of a trigger event and one or more actions that execute when the trigger fires. The automation is created in an active state by default.

Basic Example

mutation CreateAutomation {
  createAutomation(
    input: {
      trigger: {
        type: TODO_CREATED
      }
      actions: [
        {
          type: ADD_TAG
          tagIds: ["tag_abc123"]
        }
      ]
    }
  ) {
    id
    isActive
    trigger {
      id
      type
    }
    actions {
      id
      type
    }
    createdAt
  }
}

Advanced Example

mutation CreateAutomationAdvanced {
  createAutomation(
    input: {
      trigger: {
        type: TODO_LIST_CHANGED
        todoListId: "list_abc123"
        tagIds: ["tag_456"]
        assigneeIds: ["user_789"]
        color: "#FF5733"
        conditionMode: ALL
      }
      actions: [
        {
          type: CHANGE_DUE_DATE
          duedIn: 7
        }
        {
          type: ADD_ASSIGNEE
          assigneeIds: ["user_101", "user_102"]
        }
        {
          type: SEND_EMAIL
          metadata: {
            email: {
              to: ["[email protected]"]
              from: "[email protected]"
              subject: "Record moved to In Progress"
              content: "<p>A record has been moved.</p>"
              cc: ["[email protected]"]
            }
          }
        }
        {
          type: CREATE_CHECKLIST
          metadata: {
            checklists: [
              {
                title: "Review Checklist"
                position: 1.0
                checklistItems: [
                  {
                    title: "Code review"
                    position: 1.0
                    duedIn: 3
                    assigneeIds: ["user_101"]
                  }
                  {
                    title: "QA testing"
                    position: 2.0
                    duedIn: 5
                  }
                ]
              }
            ]
          }
        }
        {
          type: MAKE_HTTP_REQUEST
          httpOption: {
            url: "https://api.example.com/webhook"
            method: POST
            contentType: APPLICATION_JSON
            body: "{\"event\": \"record_moved\"}"
            headers: [
              { key: "X-Custom-Header", value: "automation" }
            ]
            authorizationType: BEARER_TOKEN
            authorizationBearerToken: "your-token-here"
          }
        }
      ]
    }
  ) {
    id
    isActive
    trigger {
      id
      type
      color
      todoList {
        id
        title
      }
      tags {
        id
        title
      }
      assignees {
        id
        name
      }
      conditionMode
      schedule {
        type
        hour
        minute
        timezone
        nextExecutionAt
      }
    }
    actions {
      id
      type
      duedIn
      assigneeTriggerer
      tags {
        id
        title
      }
      assignees {
        id
        name
      }
      metadata {
        ... on AutomationActionMetadataSendEmail {
          email {
            subject
            to
            from
          }
        }
        ... on AutomationActionMetadataCreateChecklist {
          checklists {
            title
            checklistItems {
              title
              duedIn
            }
          }
        }
      }
      httpOption {
        url
        method
        contentType
      }
    }
    createdBy {
      id
      name
      email
    }
    createdAt
    updatedAt
  }
}

Input Parameters

CreateAutomationInput

ParameterTypeRequiredDescription
triggerCreateAutomationTriggerInput!YesThe trigger event configuration
actions[CreateAutomationActionInput!]!YesOne or more actions to perform when triggered

CreateAutomationTriggerInput

ParameterTypeRequiredDescription
typeAutomationTriggerType!YesThe type of event that triggers the automation
metadataAutomationTriggerMetadataInputNoTrigger-specific metadata (e.g., overdue settings)
customFieldIdStringNoCustom field to monitor for changes
customFieldOptionIds[String!]NoSpecific custom field option IDs to match
todoListIdStringNoSpecific todo list to scope the trigger to
todoListIds[String!]NoMultiple todo lists to scope the trigger to
tagIds[String!]NoTag IDs that must match for the trigger
todoIds[String!]NoSpecific todo/record IDs to scope the trigger to
assigneeIds[String!]NoAssignee IDs that must match for the trigger
colorStringNoColor value to match (hex format)
colors[String!]NoMultiple color values to match
dueStartDateTimeNoDue date range start for filtering
dueEndDateTimeNoDue date range end for filtering
showCompletedBooleanNoWhether to include completed records
fieldsJSONNoAdditional field conditions
opFilterLogicalOperatorNoLogical operator for combining filter conditions
conditionModeConditionalAutomationModeNoMode for conditional automation matching
filterGroupsJSONNoAdvanced filter group definitions
filterGroupLinksJSONNoLinks between filter groups
scheduleCreateAutomationTriggerScheduleInputNoSchedule configuration for SCHEDULED triggers

CreateAutomationTriggerScheduleInput

ParameterTypeRequiredDescription
typeAutomationScheduleType!YesSchedule frequency type
hourInt!YesHour of day to execute (0-23)
minuteInt!YesMinute of hour to execute (0-59)
timezoneString!YesIANA timezone string (e.g., “America/New_York”)
days[Int!]NoSpecific days for the schedule
dayOfWeek[Int!]NoDays of week (0=Sunday, 6=Saturday)
dayOfMonthIntNoDay of month (1-31)
monthIntNoMonth of year (1-12)
cronExpressionStringNoCustom cron expression
isActiveBooleanNoWhether the schedule is active

AutomationTriggerMetadataInput

ParameterTypeRequiredDescription
incompleteOnlyBooleanNoOnly trigger for incomplete records
offsetIntNoOffset in minutes before/after the due date

CreateAutomationActionInput

ParameterTypeRequiredDescription
typeAutomationActionType!YesThe type of action to perform
duedInIntNoNumber of days to set for due date actions
customFieldIdStringNoTarget custom field ID
customFieldOptionIds[String!]NoCustom field option IDs to set
todoListIdStringNoTarget todo list ID
metadataAutomationActionMetadataInputNoAction-specific metadata
tagIds[String!]NoTag IDs to add or remove
assigneeIds[String!]NoAssignee IDs to add or remove
projectIds[String!]NoProject IDs for cross-project actions
colorStringNoColor value to apply (hex format)
assigneeTriggererStringNoSpecial identifier to assign the triggering user
portableDocumentIdStringNoPortable document ID for PDF generation
httpOptionAutomationActionHttpOptionInputNoHTTP request configuration

AutomationActionHttpOptionInput

ParameterTypeRequiredDescription
urlString!YesThe URL to send the request to
methodHttpMethod!YesHTTP method (GET, POST, PUT, DELETE, etc.)
headers[HttpHeaderInput]NoCustom HTTP headers
parameters[HttpParameterInput]NoQuery parameters
contentTypeHttpContentTypeNoRequest content type
bodyStringNoRequest body content
authorizationTypeHttpAuthorizationTypeNoAuthentication type
authorizationBasicAuthHttpAuthorizationBasicAuthInputNoBasic auth credentials
authorizationBearerTokenStringNoBearer token value
authorizationApiKeyHttpAuthorizationApiKeyInputNoAPI key configuration
oauthConnectionIdStringNoOAuth connection ID for authenticated requests

AutomationActionMetadataInput

ParameterTypeRequiredDescription
checklists[AutomationActionCreateChecklistInput]NoChecklists to create
copyTodoOptions[CopyTodoOption!]NoOptions for copying records
emailAutomationActionSendEmailInputNoEmail sending configuration
numberFloatNoNumeric value for custom field actions
textStringNoText value for custom field actions

Response Fields

The mutation returns an Automation object.

FieldTypeDescription
idID!Unique identifier for the automation
triggerAutomationTrigger!The configured trigger event
actions[AutomationAction!]!The configured actions
isActiveBoolean!Whether the automation is active (defaults to true)
createdByUser!The user who created the automation
projectProject!The project this automation belongs to
createdAtDateTime!Creation timestamp
updatedAtDateTime!Last update timestamp

Required Permissions

Access LevelCan Create Automations
OWNERYes
ADMINYes
MEMBERNo
CLIENTNo

Only owners and admins of an active project can create automations.

Error Responses

Authentication Required

{
  "errors": [{
    "message": "You must be logged in",
    "extensions": {
      "code": "UNAUTHENTICATED"
    }
  }]
}

When: No valid authentication token is provided.

Unauthorized

{
  "errors": [{
    "message": "Unauthorized",
    "extensions": {
      "code": "UNAUTHORIZED"
    }
  }]
}

When: The authenticated user does not have OWNER or ADMIN access to the project, or the project is archived.

Project Not Found

{
  "errors": [{
    "message": "Project not found",
    "extensions": {
      "code": "PROJECT_NOT_FOUND"
    }
  }]
}

When: The project context is invalid or the project does not exist.

Important Notes

  • Active by Default: New automations are created in an active state and will begin triggering immediately
  • Project Scope: Automations are created within the current project context
  • Scheduled Triggers: When using SCHEDULED trigger type, the schedule configuration is required and the automation will be scheduled automatically
  • Due Date Triggers: DUE_DATE_EXPIRED triggers will automatically schedule monitoring jobs for existing records
  • Conditional Automations: CONDITIONAL trigger types will pre-populate a cache for efficient evaluation
  • Multiple Actions: You can attach multiple actions to a single trigger, and they will all execute when the trigger fires
  • HTTP Actions: Use MAKE_HTTP_REQUEST action type with httpOption to call external APIs or webhooks