Create an entity workflow

POST/projects/{projectId}/entities/{entityId}/workflows

Base URL: https://api.tinkermode.com

Create a new workflow for this entity.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain the key of a user or service account with permissions to create entity workflows, or a project API key with admin permission.

Path parameters

NameTypeRequiredConstraintsDescription
projectIdintegerYesThe unique ID for a specified project.
entityIdstringYesEntity ID (unique within project)

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
descriptionstringNodefault: ""An optional description of the workflow.
enabledbooleanNodefault: falseWhether the workflow should be active immediately after creation.
namestringYesThe display name of the workflow.
stepsarray<object>NoOrdered list of steps to execute when the workflow runs.
Properties of steps
PropertyTypeRequiredConstraintsDescription
branchesobjectNoNamed branches of sub-steps, keyed by branch ID. Maximum nesting depth is 1.
idstringYesUnique identifier for the step within this workflow.
inputsobjectNoInput values passed to the node.
nodestringYesThe node type to execute for this step. Must be a registered node ID (see GET /workflow/nodes).
triggersarray<object>NoList of triggers that can start this workflow.
Properties of triggers
PropertyTypeRequiredConstraintsDescription
cronobjectNoCron trigger configuration. Required when type is 'cron'.
Properties of cron
PropertyTypeRequiredConstraintsDescription
schedulestringYesA standard 5-field cron expression (e.g. '0 9 * * 1-5').
timeZonestringNoIANA timezone name for the cron schedule (e.g. 'America/Los_Angeles'). Defaults to UTC when omitted.
idstringYesUnique identifier for the trigger within this workflow (alphanumeric, hyphens, or underscores; minimum 3 characters; normalized to lowercase).
typestringYesone of: cronThe trigger type. Currently only 'cron' is supported.

Responses

201 Workflow successfully created.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
createdAtstringNoThe time the workflow was created (ISO 8601).
descriptionstringNoAn optional description of the workflow.
enabledbooleanNoWhether the workflow is active and eligible to be triggered.
entityIdstringNoThe unique identifier for the entity the workflow belongs to.
idstringNoThe unique identifier for the workflow (MongoDB ObjectID hex string, auto-generated).
namestringNoThe display name of the workflow.
projectIdintegerNoThe unique identifier for the project the workflow belongs to.
revisionintegerNoMonotonically increasing revision number, updated on every write.
stepsarray<object>NoOrdered list of steps to execute when the workflow runs.
Properties of steps
PropertyTypeRequiredConstraintsDescription
branchesobjectNoNamed branches of sub-steps, keyed by branch ID. Used by branching nodes (e.g. condition nodes) to define which steps to run for each outcome. Maximum nesting depth is 1.
idstringNoUnique identifier for the step within this workflow.
inputsobjectNoInput values passed to the node. Supports template expressions referencing previous step outputs.
nodestringNoThe node type to execute for this step. Must be a registered node ID (see GET /workflow/nodes).
triggersarray<object>NoList of triggers that can start this workflow.
Properties of triggers
PropertyTypeRequiredConstraintsDescription
cronobjectNoCron trigger configuration. Required when type is 'cron'.
Properties of cron
PropertyTypeRequiredConstraintsDescription
schedulestringNoA standard 5-field cron expression (e.g. '0 9 * * 1-5').
timeZonestringNoIANA timezone name for the cron schedule (e.g. 'America/Los_Angeles'). Defaults to UTC when omitted.
idstringNoUnique identifier for the trigger within this workflow (alphanumeric, hyphens, or underscores; minimum 3 characters; normalized to lowercase).
typestringNoone of: cronThe trigger type. Currently only 'cron' is supported.
updatedAtstringNoThe time the workflow was last updated (ISO 8601).

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of invalid data or denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.