{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":49533,"path":"servicenow-platform/workflow-activities/r_ApprovalCoordinator.md","title":"Approval Coordinator workflow activity","bundle":null,"doc_type":null,"release":"australia","body":"\n# Approval Coordinator workflow activity\n\nThe **Approval Coordinator** activity creates an approval whose outcome depends on the outcome of one or more child activities, including one or more **Approval - User**, **Approval - Group**, and/or **Manual Approval** activities.\n\n**Note:** This activity is only available when the workflow runs on a table that extends Task.\n\nTo create an **Approval Coordinator** activity, first drag the activity onto the workflow canvas, causing the activity form to display. On the activity form, fill in the appropriate fields, then click **Submit**.\n\nAfter you click **Submit**, the activity appears on the workflow canvas. From there, specify the child activities by clicking the links that appear on the body of the activity.\n\nWhen the **Approval Coordinator** activity completes, all pending approvals that were created by any of the **Approval Coordinator** approval activities are immediately set to **No Longer Required**. If a single user is called as an approver twice by the same workflow, such as when a single user is both a product approver and an executive approver, any approvals for that user after the first are skipped.\n\n## Results\n\nThe result value of the **Approval Coordinator** activity depends on the approval actions taken by the approvers and the approval conditions specified in the **Wait for** field. Possible result values are:\n\n-   Approved\n-   Rejected\n-   Deleted\n-   Cancelled\n\n## Input variables\n\nInput variables determine the initial behavior of the activity.\n\n<table id=\"table_xql_rnw_w4\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nWait for\n\n</td><td>\n\nIndicate what to wait for to indicate that the approval activity is approved or rejected. Options are:\n\n-   **Any child activity to be approved:** Any child activity \\(User, Group, or Manual Approval\\) that completes with a result of **approved** causes the **Approval Coordinator** activity to complete with a result of **approved**.\n-   **All child activities to be approved:** All child activities of the **Approval Coordinator** activity must complete with a a result of **approved** to cause the **Approval Coordinator** activity to complete with a result of **approved**.\n-   **The first approval or rejection from any child activity:** The first child activity that completes with a result of **approved** or **rejected** causes the **Approval Coordinator** activity to complete with the same result.\n-   **Condition based on script:**Call a script to determine how to manage an approval or rejection.\n\n</td></tr><tr><td>\n\nWhen a rejection occursOnly appears if **Wait for** is set to **All child activities to be approved** or **Any child activity to be approved**.\n\n</td><td>\n\nSpecify what the coordinator should do when it sees a rejection from any one of the child activities. Options are: -   **Reject the approval:** Immediately complete the **Approval Coordinator** activity with a result of **rejected**.\n-   **Wait for other responses before deciding:** Wait until we get other responses from other child activities before making an approval or rejection decision.\n\nThis allows users to change their minds until a decision is made.\n\nIn addition, if **Wait for** is set to **Any child activity to approve** then a single child activity completion with a result of **approved** will cause the **Approval Coordinator** activity to complete with a result of **approved** even if other child activities have completed with a result of **rejected**.\n\n\n</td></tr><tr><td>\n\nApproval scriptOnly appears if **Wait for** is set to **Condition based on script**.\n\n</td><td>\n\nIf the **Wait for** variable is set to **Condition based on script** this script is called to determine how to handle an approval or rejection. The script needs to set the variable *answer* to , approved or rejected to indicate the overall approval status for this approval. When called, the following variable is available to the script:```\ncounts.total = total number of child approval activities that are part of this approval\n      counts.approved = # of child approval activities that approved so far\n      counts.rejected = # of child approval activities that rejected so far\n      counts.requested = # of child approval activities that are pending approval\n```\n\n</td></tr></tbody>\n</table>## Conditions\n\nThe conditions determine which transition runs after this activity.\n\n**Note:** Approval activities run as the user whose actions match the approve or reject conditions the workflow was waiting for and advances the workflow.\n\n|Condition|Description|\n|---------|-----------|\n|Approved|The users from the groups have approved the request based on the **Wait for** rules.|\n|Rejected|The users from the groups have rejected the request based on the **Wait for** rules.|\n\n## States\n\nThe activity state tells the workflow engine what to do with the activity.\n\n|State|Description|\n|-----|-----------|\n|Executing|The workflow engine starts the *execute* function of the activity.|\n|Waiting|The workflow engine ignores the activity until a specific event to restart the activity is fired.|\n|Finished|The activity finished running. See the result value for the outcome of the activity.|\n|Cancelled|This activity, or the workflow that contains this activity, was canceled.|\n|Error|A JavaScript error occurred. Review the logs for error details.|\n\n**Parent Topic:**[Approval and rollback workflow activities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/workflow-activities/c_ApprovalAndRollbackActivities.md)\n\n"}}