Application-level workflows

Create a workflow

Changed on

Creates an application-level workflow.

<div id="admonition-info">ℹ️ <b>You must have an existing <a href="/docs/reference/api/application-level-templates/">template</a> to create a workflow</b>.</div>
post/v3/workflows

Request

  • Base URL
    https://api.us.nylas.com
  • Auth
    HTTP bearer

Request body

delayinteger

The number of minutes between a trigger_event being met and the workflow sending a message.

is_enabledboolean

When true, indicates that the workflow is enabled.

namestring required

The name of the workflow.

template_idstring required

The ID of the email template the workflow uses.

trigger_event'booking.cancelled' | 'booking.created' | 'booking.pending' | 'booking.reminder' | 'booking.rescheduled' | 'calendar.created' | 'calendar.deleted' | 'calendar.updated' | 'contact.deleted' | 'contact.updated' | 'event.created' | 'event.deleted' | 'event.updated' | 'folder.created' | 'folder.deleted' | 'folder.updated' | 'grant.created' | 'grant.deleted' | 'grant.expired' | 'grant.imap_sync_completed' | 'grant.updated' | 'message.bounce_detected' | 'message.link_clicked' | 'message.opened' | 'message.send_failed' | 'message.send_success' | 'notetaker.created' | 'notetaker.deleted' | 'notetaker.media' | 'notetaker.meeting_state' | 'notetaker.updated' | 'thread.replied' required

The event which triggers the workflow.

grant.expired and grant.deleted require a from sender address, because the grant that triggered them can no longer send email. Every other trigger accepts a workflow without one.

Workflows have no condition or filter field, so an enabled workflow sends for every matching event in its scope. High-volume triggers such as message.opened fire for every open of every tracked message the workflow covers.

Example request

{
  "delay": 5,
  "is_enabled": true,
  "name": "New booking confirmation workflow",
  "template_id": "14c00cc8-648c-4381-ad10-52641d9bac8e",
  "trigger_event": "booking.created",
  "from": {
    "email": "support@example.com",
    "name": "Support"
  }
}

Response

Success. Returns workflow.

request_idstring required

The ID of the request.

Example response

{
  "data": {
    "app_id": "6c45fe5e-0bb6-41b9-9acc-ccb15bfc51eb",
    "date_created": 1756477389,
    "delay": 5,
    "grant_id": "6c45fe5e-0bb6-41b9-9acc-ccb15bfc51eb",
    "id": "b79c82b2-a51b-4c54-8469-28006a43551a",
    "is_enabled": true,
    "name": "New booking confirmation workflow",
    "template_id": "14c00cc8-648c-4381-ad10-52641d9bac8e",
    "trigger_event": "booking.created",
    "from": {
      "email": "support@example.com",
      "name": "Support"
    }
  }
}

Changes

    • breaking

      removed the enum value message.created of the request property

    • breaking

      removed the enum value message.updated of the request property

    • info

      removed the message.created enum value from the / response property for the response status

    • info

      removed the message.updated enum value from the / response property for the response status

    • warning

      added the new calendar.created enum value to the / response property for the response status

    • warning

      added the new calendar.deleted enum value to the / response property for the response status

    • warning

      added the new calendar.updated enum value to the / response property for the response status

    • warning

      added the new contact.deleted enum value to the / response property for the response status

    • warning

      added the new contact.updated enum value to the / response property for the response status

    • warning

      added the new event.created enum value to the / response property for the response status

    • warning

      added the new event.deleted enum value to the / response property for the response status

    • warning

      added the new event.updated enum value to the / response property for the response status

    • warning

      added the new folder.created enum value to the / response property for the response status

    • warning

      added the new folder.deleted enum value to the / response property for the response status

    • warning

      added the new folder.updated enum value to the / response property for the response status

    • warning

      added the new grant.created enum value to the / response property for the response status

    • warning

      added the new grant.deleted enum value to the / response property for the response status

    • warning

      added the new grant.expired enum value to the / response property for the response status

    • warning

      added the new grant.imap_sync_completed enum value to the / response property for the response status

    • warning

      added the new grant.updated enum value to the / response property for the response status

    • warning

      added the new message.bounce_detected enum value to the / response property for the response status

    • warning

      added the new message.created enum value to the / response property for the response status

    • warning

      added the new message.link_clicked enum value to the / response property for the response status

    • warning

      added the new message.opened enum value to the / response property for the response status

    • warning

      added the new message.send_failed enum value to the / response property for the response status

    • warning

      added the new message.send_success enum value to the / response property for the response status

    • warning

      added the new message.updated enum value to the / response property for the response status

    • warning

      added the new notetaker.created enum value to the / response property for the response status

    • warning

      added the new notetaker.deleted enum value to the / response property for the response status

    • warning

      added the new notetaker.media enum value to the / response property for the response status

    • warning

      added the new notetaker.meeting_state enum value to the / response property for the response status

    • warning

      added the new notetaker.updated enum value to the / response property for the response status

    • warning

      added the new thread.replied enum value to the / response property for the response status

    • info

      added the new calendar.created enum value to the request property

    • info

      added the new calendar.deleted enum value to the request property

    • info

      added the new calendar.updated enum value to the request property

    • info

      added the new contact.deleted enum value to the request property

    • info

      added the new contact.updated enum value to the request property

    • info

      added the new event.created enum value to the request property

    • info

      added the new event.deleted enum value to the request property

    • info

      added the new event.updated enum value to the request property

    • info

      added the new folder.created enum value to the request property

    • info

      added the new folder.deleted enum value to the request property

    • info

      added the new folder.updated enum value to the request property

    • info

      added the new grant.created enum value to the request property

    • info

      added the new grant.deleted enum value to the request property

    • info

      added the new grant.expired enum value to the request property

    • info

      added the new grant.imap_sync_completed enum value to the request property

    • info

      added the new grant.updated enum value to the request property

    • info

      added the new message.bounce_detected enum value to the request property

    • info

      added the new message.created enum value to the request property

    • info

      added the new message.link_clicked enum value to the request property

    • info

      added the new message.opened enum value to the request property

    • info

      added the new message.send_failed enum value to the request property

    • info

      added the new message.send_success enum value to the request property

    • info

      added the new message.updated enum value to the request property

    • info

      added the new notetaker.created enum value to the request property

    • info

      added the new notetaker.deleted enum value to the request property

    • info

      added the new notetaker.media enum value to the request property

    • info

      added the new notetaker.meeting_state enum value to the request property

    • info

      added the new notetaker.updated enum value to the request property

    • info

      added the new thread.replied enum value to the request property