const url = 'https://platform.fomr.io/v1/forms/example/workflows/example/enable';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://platform.fomr.io/v1/forms/example/workflows/example/enable \ --header 'Authorization: Bearer <token>'Turns the workflow on so it runs when a respondent completes the form, after the checks the app runs: one trigger, every node connected to it, no loops, a valid config and a connected account on every step. A failed check answers 400 with the issue at its path in the Workflow Document and records validation_status invalid, as in the app. The plan caps enabled workflows per form with max_active_workflows_per_form; over it the call answers 402. An enabled workflow that passed its checks answers 200 and writes nothing. Needs forms:write and workflows:write. Costs 1 API credit.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The public ID of the form the workflow belongs to.
The public ID of the workflow, as listFormWorkflows returns it.
Responses
Section titled “Responses”The Workflow Document: a workflow of a form with its whole graph. Read it, change it, and send it back to replace it.
The Workflow Document: a workflow of a form with its whole graph. Read it, change it, and send it back to replace it.
object
The public ID of the workflow. Use it in the other workflow calls.
Workflow name shown in the Workflows tab of the form.
Whether the workflow runs when a respondent completes the form. Change it with enable and disable.
Unchecked until the workflow is first enabled, valid once it passed the enable checks, invalid when the last check failed.
When the workflow was created.
When the workflow last changed.
The nodes of the workflow graph, oldest first. Issue paths index into this array.
Node type form_completed: New response. Runs when a respondent completes this form. Kind: trigger.
object
The public ID of the node. Edges name their endpoints with it.
Discriminates the node type. A node keeps its type: to change it, replace the node with a new one.
Canvas position of the node in the app workflow builder. It has no effect on how the workflow runs.
object
Horizontal canvas coordinate of the node in the app workflow builder.
Vertical canvas coordinate of the node in the app workflow builder.
Node type google_sheets_add_row: Sync to Google Sheets. Append a completed response to a spreadsheet. Kind: action.
object
The public ID of the node. Edges name their endpoints with it.
Discriminates the node type. A node keeps its type: to change it, replace the node with a new one.
Canvas position of the node in the app workflow builder. It has no effect on how the workflow runs.
object
Horizontal canvas coordinate of the node in the app workflow builder.
Vertical canvas coordinate of the node in the app workflow builder.
The Google Sheets destination of the step. Once set, fomr creates the spreadsheet, and the destination cannot change afterwards: replace the node with a new one to use another spreadsheet.
object
The public ID of a connected Google Sheets connection of the organization, as listIntegrationConnections returns it.
Name of the spreadsheet fomr creates in that Google account to receive the completed responses, trimmed.
The spreadsheet fomr created for the step. Read-only.
The edges of the workflow graph, oldest first. Issue paths index into this array.
A connection that runs the target node after the source node.
object
The public ID of the edge.
The public ID of the node the edge starts from.
The public ID of the node the edge leads to.
Example
{ "validation_status": "unchecked", "validation_error_code": "WORKFLOW_VALIDATION_TOO_MANY_WORKFLOWS", "nodes": [ { "node_type_key": "form_completed" } ]}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Every value the request got wrong.
object
The path into the request, with property names and numeric array indexes.
What is wrong with the value at this path.
The stable code for the issue. Branch on it, and use it with params to write your own text.
Accepted values when a node type or enum value is rejected.
Example
{ "code": "INVALID_INPUT"}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}Default Response
object
The organization is already at a limit its plan sets.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
The plan whose limit was applied.
Where to review plans and upgrade the organization.
The limit that blocked the call.
object
Which plan limit was reached.
What the plan allows.
What the organization is using right now.
Example
{ "code": "PLAN_LIMIT_REACHED", "plan": "free", "limit": { "key": "max_forms" }}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}Default Response
object
Returned for a form or workflow that does not exist, is in Trash or deleted, belongs to another organization, or for a Private Template, which has no workflows. These cases are not told apart.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "NOT_FOUND"}A rejected call. The organization budget names the policy it rejected the call under; the request floor that bounds hammering sends the envelope alone.
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
The policy that rejected the call.
The plan whose numbers were applied.
The policy limit in credits.
Credits already spent in the open window.
Credits still available under the policy.
What the rejected call would have cost.
How long the policy window lasts.
When the window that rejected the call ends.
Seconds to wait before retrying. Also sent as the Retry-After response header.
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT", "policy": "minute", "plan": "free"}Default Response
object
The stable code to branch on.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Example
{ "code": "INVALID_INPUT"}Default Response
object
The requested operation has no available capacity. Retry after the Retry-After header says.
A human-readable explanation. Not part of the contract; never branch on it.
The ID of the failed request, also sent as the X-Request-Id response header.
Seconds to wait before retrying. Also sent as the Retry-After response header.
Example
{ "code": "SERVICE_UNAVAILABLE"}