Required Scopes
Required Scopes
Scope requirements
The following additional app permissions are required to use the workflows API, based on the endpoints you’re using:workflows.read: grants access to view details about workflows and workflow definitions. This scope is required for all endpoints.workflows.write: grants access to create and modify workflows. This is required for all modification endpoints.workflows.trigger: grants access to manually run a workflow.
crm.objects.contacts.sensitive.read: view enrollment and performance data for existing contact-based workflows.crm.objects.companies.sensitive.read: view enrollment and performance data for existing company-based workflows.crm.objects.deals.sensitive.read: view enrollment and performance data for existing deal-based workflows.crm.objects.custom.sensitive.read: view enrollment and performance data for workflows based on custom objects in an account.
Create a new workflow run
To create a new workflow run, you’ll need to send the following requests:- First, retrieve run inputs using a
GETrequest to/automation/workflows-runs/2027-03-beta/run-inputs/{flowId}. - After retrieving necessary inputs, send a
POSTrequest to/automation/workflows-runs/2027-03-beta/run.
Retrieve run inputs
To retrieve workflow run inputs, make aGET request to /automation/workflows-runs/2027-03-beta/run-inputs/{flowId}. Replace {flowId} with the ID of the workflow.
The response lists each required input in the requiredInputs array. Each input includes the actionIds of the workflow actions that use it.
requiredInputs: the inputs required to start a run.tokenString: the name of the input. Use this value as thetokenStringwhen you start a run.fieldTypeDefinition: the data type of the input. This includesname,type,label,description, andpropertyFieldType.actionIds: the IDs of any workflow actions that use this input.triggerObjectTypeId: the object type ID for the workflow’s trigger.
Example retrieve run inputs response
Start a manual workflow run
To start a new manual workflow run, make aPOST request to /automation/workflows-runs/2027-03-beta/run.
In the body of your request, include the workflow’s ID and a value for each required input. You can also include the CRM record that the run applies to. The workflow must be published (turned on) to run. If the request is successful, a 201 status code and the ID of the new run will be returned.
In the following example, the request will run the workflow with the
flowId of 001001. The new run will have a runId of 12121.
- Example request
- Example response
Retrieve a workflow run’s status
To check on the status of your workflow run, make aGET request to /automation/workflows-runs/2027-03-beta/run/{runId}. Replace {runId} with the ID returned by the start request.
The enrollmentState will reflect the status of the run:
RUNNING: the run is in progress.CANCELED: the run was canceled. Learn how to cancel a workflow run.COMPLETED: the run finished.FAILED: the run failed.
Example workflow run status response
Cancel a workflow run
To cancel a run, make aPOST request to /automation/workflows-runs/2027-03-beta/run/unenroll. Identify the run by its workflow ID and CRM record. If the cancellation is successful, the response will return a 204 status code and no body.
Retrieve runs for a specific workflow
To check a workflow’s runs over a specified period of time, make aPOST request to /automation/workflows-reporting/2027-03-beta/performance/query. Include the workflow ID, a start date, an end date, and a frequency.
The response data will include the following:
startDate: the start of the requested range.endDate: the end of the requested range.frequency: the frequency that the results are grouped by.counters: the performance data for each period that has data.date: the start date of the period.runsTotal: the total number of runs in the period.currentlyRunningTotal: the number of runs that are still in progress.completedTotal: the number of completed runs.canceledEarlyTotal: the number of runs that were canceled before they finished.failedTotal: the number of failed runs.uniqueCrmObjectRunsTotal: the number of unique CRM records that had a run in the period.
flowId of 001001, from January 1st, 2026, to February 1st, 2026.
- Example request
- Example response
Retrieve all current workflow runs for a CRM record
To find all workflows that a CRM record is currently running in, make aGET request to /automation/workflows-reporting/2027-03-beta/current-runs/{objectType}/{objectId}. Replace {objectType} with an object type and {objectId} with the ID of the record. If the record has no current runs, the response has a 200 status code and an empty results array.
The response will include:
results: current runs for the CRM record.flowId: the ID of the workflow.runId: the ID of the run.
Example retrieve workflow runs response