Sends a record for approval when specific criteria are met. The workflow enters a suspended state until the approval engine responds. Once a response is received, the workflow automatically resumes. Depending on the approval engine's response, the workflow will either follow the Approved or Rejected path.
On the product side, the workflow runtime API provides the status of the approval activity, including actions like Complete, SubmitApproval, or Override. The product uses this information to display a "Submit for Approval" button, allowing users to submit the object for approval.
Submit Runtime API details
Once the specific entry criteria are met and the workflow is in a suspended state, the system uses the APIs below to submit the approval request for the context record.
API endpoints
Standalone Workflow: POST /api/workflow/v1/runtime/workflow-instances/{workflowInstanceId}/activities/{activityId}/submit-approval
Staged Workflow: POST /api/workflow/v1/runtime/stage-instances/{stageInstanceId}/activities/{activityId}/submit-approval
CODE
Sample request payload
Standalone Workflow:
{
"workflowInstanceId": "74c83333-f7d9-4e96-aa27-3c4c3581a2e4",
"ActivityId": "5010c7bc-bf0f-4605-9c56-2299a683440a",
"Comments": "User Notes"
}
Staged Workflow:
{
"StageInstanceId": "74c83333-f7d9-4e96-aa27-3c4c3581a2e4",
"ActivityId": "5010c7bc-bf0f-4605-9c56-2299a683440a",
"Comments": "User Notes"
}
CODE
Example:
In a contract approval process, the Approval Activity pauses the workflow for review when a contract meets certain criteria, like a high value. The manager or legal team reviews and submits it for approval. If approved, the contract moves to finalization. If rejected, it goes back for revisions.
Properties and activity information
Properties determines the initial behavior of the activity.
Field | Description |
---|
Properties |
---|
Entry Criteria | Set the conditions that must be met to trigger the workflow. - Field: Select the field you want to set as the condition criterion. It lists fields associated with the object you have selected at the time of workflow creation.
- Operator: You must select the logical operator from the list. This forms the relationship between the field and its value.
- Value: The value field changes based on the selected operator options. Enter or select the value for the specified field.
To add more conditions, click Add Criteria. To remove all conditions, click Remove All. |
Filter Expression | By default, the application applies AND logic to all criteria. You can adjust this to create more complex logical expressions if needed. You can customize your logic using parentheses, AND, OR, and NOT. For example, if you enter “(1 AND 2 AND 3) OR 4”, the system will evaluate whether all three of the first conditions are true, or if the fourth condition is true. |
Criteria Expression | Displays the criteria expression based on the selected field, operator, and value condition. For example, ( Agreement.TotalContractValue> ("1200") and ( Agreement.RecordType= ("MSA") or Agreement.RecordType= ("NDA") )) |
Common |
---|
Name | Enter the technical name of the activity. |
Display Name | This field auto-populates but can be changed if needed. |
Description | Provide a description that is relevant to the activity. |