SheetgoDevelopers

Developers › REST API › Workflows & Automations

REST API · 3 endpoints

triggers

Complete for this group. Each operation below lists its parameters, request body, responses and errors. Every model they use is documented under Models used on this page, so you do not need another page to build a request. Base URL https://dev-api.sheetgo.com; send Authorization: Bearer sg_…. Latest version: https://dev-api.sheetgo.com/rest/reference/triggers (Markdown).

Conventions for every endpoint. Lists take page (from 1) and per_page (1-100, default 50), and total counts pages, not items. Collection URLs end with /. POST …/run returns 200 when the run is queued; poll GET …/run. Google Sheets use provider: "drive"; column fields take letters ("E"). Error bodies and status codes: api.html#api-errors.

Python recipes. API client helper.

A trigger defines what makes a workflow run automatically, so you set it once instead of running the workflow by hand. A trigger can be a recurring schedule (e.g. every 15 minutes, or every weekday at 09:00) or the completion of another workflow (chaining one run after another). Each workflow has at most one active trigger.

Use these endpoints to read, set or replace, and remove a workflow's trigger. All endpoints are under /rest/beta and require auth via session JWT or sg_… API key Bearer token.

Endpoints

Method Path Purpose
GET /rest/beta/workflows/{id}/trigger Read the current trigger configuration
PUT /rest/beta/workflows/{id}/trigger Set or replace the trigger (idempotent)
DELETE /rest/beta/workflows/{id}/trigger Turn the trigger off

Trigger type: time (schedule)

Run the workflow on a recurring schedule. Use friendly fields (recommended) or a raw cron expression — the two forms are mutually exclusive; supplying both returns 422.

Friendly fields
{ "type": "time", "frequency": "daily", "time": "09:00", "timezone": "Europe/Berlin" }
Field Required for Allowed values
frequency always minutes, hourly, daily, weekly, monthly
every minutes, hourly minutes: 15 or 30; hourly: 1, 2, 4, 6, 8, 12
time daily, weekly, monthly "HH:MM" — minute is always coerced to :00
weekday weekly a day name (sunday … saturday) or a list of day names for multiple days, e.g. ["monday","thursday"]
day_of_month monthly 1–31 or "last"
timezone optional IANA name (e.g. "America/New_York"). Defaults to the workflow's current timezone.

HH:00 constraint: The minute component of time is always silently coerced to 00. Schedules run at the top of the hour. "09:45" is stored and executed as "09:00".

Friendly → cron mapping
Friendly input Generated cron
minutes, every 15 */15 * * * *
minutes, every 30 */30 * * * *
hourly, every N (1, 2, 4, 6, 8, 12) 0 0-23/N * * *
daily at hour H 0 H * * *
weekly at hour H on weekday(s) D 0 H * * D (sunday=0 … saturday=6; multiple days → 0 H * * 1,2,4,5)
monthly at hour H on day DOM 0 H DOM * * ("last" → L)
Reading a trigger (GET) — cron is authoritative

cron is always the source of truth. The friendly fields (frequency, every, time, weekday, day_of_month) are a convenience filled in only when the schedule maps cleanly to the table above:

  • A weekly schedule with one day returns weekday as a string; with several days it returns a list (cron day lists like 1,2,4,5 and ranges like 1-5 are both parsed).
  • Advanced / compound schedules are not expressed in the friendly fields. Schedules created in the Sheetgo dashboard can combine things the friendly syntax does not model — an hour window, an hour step, and a weekday restriction together (e.g. 0 6-18/2 * * 1,2,3,4,5 = every 2 hours from 06:00–18:00, Monday–Friday). For these, every friendly field is null and only cron is populated. Read cron to get the exact schedule.
Raw cron expression (power-user escape hatch)
{ "type": "time", "cron": "0 9 * * *", "timezone": "UTC" }
  • Provide cron instead of friendly fields. The two forms are mutually exclusive.
  • The minute field must be 0, */15, or */30. Any other value returns 422 invalid_trigger.

Trigger type: workflow_finished (chained execution)

Run this workflow immediately after another workflow completes.

{ "type": "workflow_finished", "after_workflow_id": "abc123" }
  • after_workflow_id is the parent workflow whose completion fires this trigger.
  • Requires workflow ownership (not just edit permission) — see not_workflow_owner below.
  • Returns 409 circular_trigger if the relationship would create a trigger loop.

Response shape

GET and PUT return the full read model; DELETE returns the disabled state.

{
  "active": true,
  "type": "time",
  "frequency": "daily",
  "every": null,
  "time": "09:00",
  "weekday": null,
  "day_of_month": null,
  "cron": "0 9 * * *",
  "timezone": "Europe/Berlin",
  "after_workflow_id": null
}

An inactive / never-set trigger returns { "active": false, "type": null, ... } with all other fields null.

curl examples

Daily time trigger:

curl -X PUT /rest/beta/workflows/{id}/trigger \
  -H "Authorization: Bearer sg_..." \
  -H "Content-Type: application/json" \
  -d '{"type":"time","frequency":"daily","time":"09:00","timezone":"Europe/Berlin"}'

15-minute interval:

curl -X PUT /rest/beta/workflows/{id}/trigger \
  -H "Authorization: Bearer sg_..." \
  -H "Content-Type: application/json" \
  -d '{"type":"time","frequency":"minutes","every":15}'

workflow_finished trigger:

curl -X PUT /rest/beta/workflows/{id}/trigger \
  -H "Authorization: Bearer sg_..." \
  -H "Content-Type: application/json" \
  -d '{"type":"workflow_finished","after_workflow_id":"parent-workflow-id"}'

Turn off a trigger:

curl -X DELETE /rest/beta/workflows/{id}/trigger \
  -H "Authorization: Bearer sg_..."

Error codes

All errors return { "code": "...", "detail": "..." }.

HTTP code When
422 invalid_trigger Bad/missing fields, both cron and friendly fields supplied, or raw-cron minute not 0, */15, */30.
403 permission_denied Caller lacks edit or disable permission on the workflow.
403 not_workflow_owner workflow_finished requires workflow ownership.
403 plan_upgrade_required The account plan does not include this trigger type or feature.
409 circular_trigger The chosen parent would create a trigger loop.
404 workflow_not_found The workflow (or parent) does not exist or is not accessible.
500 — { "status": 0, "error": "internal" }

Operations

GET/rest/beta/workflows/{id}/triggerGet a workflow's automation trigger

Returns the workflow's current trigger — what makes it run without anyone pressing a button.

Only the fields belonging to the active type are populated; the rest are null. A workflow with no trigger returns {"active": false, "type": null} with HTTP 200, not a 404.

Parameters
NameInTypeDescription
idpathstringrequiredWorkflow id
Responses
StatusMeaningBody
200Current trigger configurationTriggerOut
401Authentication failed or token is invalid—
404Workflow not found—
422Validation ErrorHTTPValidationError
Example request
curl -s -X GET "https://dev-api.sheetgo.com/rest/beta/workflows/ID/trigger" \
  -H "Authorization: Bearer $SHEETGO_API_KEY"
PUT/rest/beta/workflows/{id}/triggerSet or replace a workflow's automation trigger

Sets the workflow's trigger, replacing any existing one — this is a full replacement, not a merge.

Pick one of three type values:

  • time — run on a schedule. Use the friendly fields (frequency, every, time, weekday, day_of_month) or a raw cron, never both. Schedules run on the hour, so the cron minute must be 0, */15 or */30.
  • workflow_finished — run when another workflow finishes, named by after_workflow_id. Chains that would form a loop are rejected with 409.
  • form_submission — run whenever a bound form receives a response.

The response echoes the stored trigger, including the resolved cron.

Parameters
NameInTypeDescription
idpathstringrequiredWorkflow id
Request body (required)

application/json · one of (chosen by type): type: "form_submission" → FormSubmissionTriggerIn, type: "time" → TimeTriggerIn, type: "workflow_finished" → WorkflowFinishedTriggerIn

Responses
StatusMeaningBody
200Trigger setTriggerOut
401Authentication failed or token is invalid—
403Permission / plan / owner restriction—
404Workflow (or parent) not found—
409Circular trigger—
422Invalid trigger configuration—
Example request
curl -s -X PUT "https://dev-api.sheetgo.com/rest/beta/workflows/ID/trigger" \
  -H "Authorization: Bearer $SHEETGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
DELETE/rest/beta/workflows/{id}/triggerTurn off a workflow's automation trigger

Disables the workflow's trigger, so it runs only on demand. Returns the trigger in its disabled state (active: false). Safe to call on a workflow that has no trigger.

Parameters
NameInTypeDescription
idpathstringrequiredWorkflow id
Responses
StatusMeaningBody
200Trigger disabledTriggerOut
401Authentication failed or token is invalid—
403Permission restriction—
404Workflow not found—
422Validation ErrorHTTPValidationError
Example request
curl -s -X DELETE "https://dev-api.sheetgo.com/rest/beta/workflows/ID/trigger" \
  -H "Authorization: Bearer $SHEETGO_API_KEY"

Models used on this page

Every request and response model referenced above, including nested ones (6). The full catalogue is on api-models.html.

FormSubmissionTriggerIn

Run this workflow whenever a bound Sheetgo form receives a new response.

FieldTypeDescription
form_idstringrequiredId of a form attached to this workflow.
type"form_submission"requiredSelects a form_submission trigger: the workflow runs each time the form named by form_id receives a response.

Used by: PUT /rest/beta/workflows/{id}/trigger

HTTPValidationError

FieldTypeDescription
detailarray of ValidationErroroptional

Used by: GET /rest/beta/workflows/, POST /rest/beta/workflows/, POST /rest/beta/workflows/run/{id}, GET /rest/beta/workflows/{id}, PATCH /rest/beta/workflows/{id}, DELETE /rest/beta/workflows/{id}, GET /rest/beta/workflows/{id}/collaborators, POST /rest/beta/workflows/{id}/collaborators, DELETE /rest/beta/workflows/{id}/collaborators, PATCH /rest/beta/workflows/{id}/collaborators/{email}, DELETE /rest/beta/workflows/{id}/collaborators/{email}, GET /rest/beta/workflows/{id}/destinations, GET /rest/beta/workflows/{id}/files, GET /rest/beta/workflows/{id}/general-access, PUT /rest/beta/workflows/{id}/general-access, DELETE /rest/beta/workflows/{id}/general-access, POST /rest/beta/workflows/{id}/leave, POST /rest/beta/workflows/{id}/request-access, GET /rest/beta/workflows/{id}/run, POST /rest/beta/workflows/{id}/run, GET /rest/beta/workflows/{id}/sources, GET /rest/beta/automations/, POST /rest/beta/automations/run/{id}, GET /rest/beta/automations/{id}, DELETE /rest/beta/automations/{id}, GET /rest/beta/automations/{id}/destinations, GET /rest/beta/automations/{id}/files, GET /rest/beta/automations/{id}/run, POST /rest/beta/automations/{id}/run, GET /rest/beta/automations/{id}/sources, GET /rest/beta/workflows/{id}/trigger, DELETE /rest/beta/workflows/{id}/trigger, GET /rest/beta/workflows/{id}/dashboard, DELETE /rest/beta/workflows/{id}/dashboard/elements/{element_id}, GET /rest/beta/workflows/{id}/dashboard/elements/{element_id}/data, PUT /rest/beta/workflows/{id}/dashboard/publish, GET /rest/beta/workflows/{workflow_id}/forms/, POST /rest/beta/workflows/{workflow_id}/forms/, GET /rest/beta/workflows/{workflow_id}/forms/{form_id}, PATCH /rest/beta/workflows/{workflow_id}/forms/{form_id}, DELETE /rest/beta/workflows/{workflow_id}/forms/{form_id}, GET /rest/beta/workflows/{workflow_id}/forms/{form_id}/responses, HEAD /rest/beta/workflows/{workflow_id}/forms/{form_id}/responses, GET /rest/beta/automations/{automation_id}/webhook, GET /rest/beta/workflows/{workflow_id}/webhooks, GET /rest/beta/api-destination/{public_id}, HEAD /rest/beta/api-destination/{public_id}, GET /rest/beta/integrations/{provider}/options, GET /rest/beta/outlook/messages, POST /rest/beta/outlook/messages/batch, GET /rest/beta/outlook/messages/{message_id}, GET /rest/beta/outlook/messages/{message_id}/attachments/{attachment_id}, POST /rest/beta/outlook/send, POST /rest/beta/gmail/send, GET /rest/beta/files/{provider}, GET /rest/beta/files/{provider}/roots, GET /rest/beta/files/{provider}/search, GET /rest/beta/files/{provider}/{file_id}, GET /rest/beta/bigquery/projects, GET /rest/beta/bigquery/projects/{project}/datasets, GET /rest/beta/bigquery/projects/{project}/datasets/{dataset}/tables, GET /rest/beta/bigquery/projects/{project}/datasets/{dataset}/tables/{table}, POST /rest/beta/bigquery/projects/{project}/validate-query, POST /rest/auth/refresh, POST /rest/auth/token

TimeTriggerIn

Time/smart schedule. Either friendly fields OR a raw cron, not both.

FieldTypeDescription
cronstringnullablePower-user escape hatch. Mutually exclusive with friendly fields.
day_of_monthinteger or stringnullablemonthly only: 1..31 or 'last'
everyintegernullableminutes: 15|30 ; hourly: 1|2|4|6|8|12
frequencyone of "minutes", "hourly", "daily", "weekly", "monthly"nullableSchedule frequency
timestringnullableHH:MM for daily/weekly/monthly. Minute is coerced to :00.
timezonestringnullableIANA timezone; defaults to the workflow's current timezone.
type"time"requiredSelects a time trigger: the workflow runs on a schedule. Set either the friendly fields below or cron, not both.
weekdaystring or array of stringnullableweekly only: a day name (sunday..saturday) or a list of names

Used by: PUT /rest/beta/workflows/{id}/trigger

TriggerOut

Read model echoed by GET and returned by PUT.

Only the fields belonging to the active trigger type are populated; all others are null. When active is false, type is null too and every other field is empty — that is the shape of a workflow with no trigger.

FieldTypeDescription
activebooleanoptionalWhether a trigger is currently set and enabled. When false, every other field is null and the workflow runs only on demand.
Default: false
after_workflow_idstringnullableworkflow_finished triggers only: the id of the parent workflow whose completion starts this one.
cronstringnullabletime triggers only: the effective five-field cron expression the schedule resolved to. Always present for a time trigger, whether it was created from cron or from the friendly fields.
day_of_monthinteger or stringnullabletime triggers, monthly only: the day of the month (1..31), or the string last for the final day of each month.
everyintegernullabletime triggers only: the interval within frequency — minutes: 15 or 30; hourly: 1, 2, 4, 6, 8 or 12.
form_idstringnullableform_submission triggers only: the id of the form whose new responses start this workflow.
frequencystringnullabletime triggers only: minutes, hourly, daily, weekly or monthly. Null when the trigger was set with a raw cron.
timestringnullabletime triggers only: HH:MM in timezone, for daily, weekly and monthly frequencies. The minute is always :00.
timezonestringnullabletime triggers only: the IANA timezone the schedule is evaluated in (for example Europe/Madrid).
typeone of "time", "workflow_finished", "form_submission"nullableWhich kind of trigger is set, and therefore which fields below are populated. Null when active is false.
weekdaystring or array of stringnullabletime triggers, weekly only: a day name (sunday..saturday), or a list of them when the schedule repeats on several days.

Used by: GET /rest/beta/workflows/{id}/trigger, PUT /rest/beta/workflows/{id}/trigger, DELETE /rest/beta/workflows/{id}/trigger

ValidationError

FieldTypeDescription
locarray of string or integerrequired
msgstringrequired
typestringrequired

WorkflowFinishedTriggerIn

Run this workflow when another workflow finishes.

FieldTypeDescription
after_workflow_idstringrequiredParent workflow whose completion triggers this one (named 'after_' to distinguish it from the path {id}).
type"workflow_finished"requiredSelects a workflow_finished trigger: the workflow runs when the workflow named by after_workflow_id completes.

Used by: PUT /rest/beta/workflows/{id}/trigger