<h2>Approval - User workflow activity</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2025" /><meta name="DC.rights.owner" content="(C) Copyright 2025" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="reference" /><meta name="DC.title" content="Approval - User workflow activity" /><meta name="abstract" content="The Approval - User activity creates one or more individual user approvals." /><meta name="description" content="The Approval - User activity creates one or more individual user approvals." /><meta name="DC.subject" content="Approval User, Results, Input Variables, Conditions, States" /><meta name="keywords" content="Approval User, Results, Input Variables, Conditions, States" /><meta name="DC.relation" scheme="URI" content="../../../administer/workflow-activities/concept/c_ApprovalAndRollbackActivities.html" /><meta name="DC.relation" scheme="URI" content="../../../administer/build-workflows/concept/build-workflows.html" /><meta name="DC.relation" scheme="URI" content="../../../administer/workflow/concept/c_WorkflowOverview.html" /><meta name="DC.relation" scheme="URI" content="../../../administer/using-workflows/concept/c_WorkflowActivities.html" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2023-08-03" /><meta name="mini-toc" content="yes" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="r_ApprovalUser" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Approval - User workflow activity</title></head><body id="r_ApprovalUser"> <div class="breadcrumb"><a class="link" href="../../../administer/build-workflows/concept/build-workflows.html" title="Transform manual tasks and mundane work into digital workflows. Modernize legacy processes with hyperautomation. Enable citizen automation from one platform.">Build workflows</a> > <a class="link" href="../../../administer/workflow/concept/c_WorkflowOverview.html" title="Workflow provides a drag-and-drop interface for automating multi-step processes across the platform. Each workflow consists of a sequence of activities, such as generating records, notifying users of pending approvals, or running scripts. The graphical Workflow Editor represents workflows visually as a type of flowchart. It shows activities as boxes labeled with information about that activity and transitions from one activity to the next as lines connecting the boxes.">Classic Workflow</a> > <a class="link" href="../../../administer/using-workflows/concept/c_WorkflowActivities.html" title="Workflow activity properties reference">Workflow activities</a> > </div> <h1 class="title topictitle1" id="ariaid-title1">Approval - User workflow activity</h1> <div class="body refbody"><p class="shortdesc"> <span class="ph" id="wf-approval-user-shortdesc">The <span class="ph uicontrol">Approval - User</span> activity creates one or more individual user approvals.</span> </p> <div class="section"><h2 class="title sectiontitle">Results</h2> <div class="p">The result value is the final approval disposition. This disposition depends on the approval actions take by the approvers and the approval conditions specified in the <span class="ph uicontrol">Wait for</span> or <span class="ph uicontrol">When Anyone Rejects</span> fields. Possible result values are:<ul class="ul" id="r_ApprovalUser__ul_r5r_hvw_w4"><li class="li">Approved</li><li class="li">Rejected</li><li class="li">Deleted</li><li class="li">Cancelled</li></ul> </div> </div> <div class="section"><h2 class="title sectiontitle">Input variables</h2> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_ApprovalUser__table_xql_rnw_w4" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 1. </span>Approval - User activity input variables</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d86212e114">Field</th><th class="entry cellrowborder" style="vertical-align:top;" id="d86212e117">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder subhead" colspan="2" style="vertical-align:top;" headers="d86212e114 d86212e117 ">Approval - User When <p class="p">Specify when this activity generates a user approval record.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Condition</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">Conditions which, if met, cause the individual approval to be generated. If the conditions are not met, the approval is skipped.</td></tr><tr class="row"><td class="entry cellrowborder subhead" colspan="2" style="vertical-align:top;" headers="d86212e114 d86212e117 ">Approval - User Approvers <p class="p">Specify the users whose approval will be requested.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Users</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">The users for the approval. Use the tree icon to select user reference fields from the current record to create approvals, such as <code class="ph codeph">${assigned_to}</code>. If no user is selected, the activity automatically sets the approval to <span class="ph uicontrol">Approved</span>. <div class="note"><span class="notetitle">Note:</span> Workflow only manages approval records generated by the Approval User activity. After starting the workflow, newly added approvals do not affect the workflow context.</div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Groups</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">Groups whose members should also receive approvals. Note that this is different than the <span class="ph uicontrol">Approval - Group</span> activity, which creates a group approval in addition to the individual approvals. The tree icon can be used to select group reference fields from the current record to create approvals, such as <code class="ph codeph">${assignment_group}</code>.</td></tr><tr class="row"><td class="entry cellrowborder subhead" colspan="2" style="vertical-align:top;" headers="d86212e114 d86212e117 ">Approval - User Condition <p class="p">Specify how the activity decides to approve or reject the approval, based on the responses from individual approvers.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Wait for</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">A choice between different approval logics to determine which individual approvals result in approval of the activity's approval. Options are:<ul class="ul" id="r_ApprovalUser__ul_mtp_jzz_xs"><li class="li"> <span class="ph uicontrol">Anyone to approve:</span> Any user can approve and the first approval causes the activity to complete with a result of <span class="ph uicontrol">approved</span>.</li><li class="li"> <span class="ph uicontrol">Everyone to approve:</span> All users must approve (see below for how a rejection is handled).</li><li class="li"> <span class="ph uicontrol">First response from anyone:</span> The first approval or rejection from any user causes the activity to complete.</li><li class="li"> <span class="ph uicontrol">Condition based on script:</span> Each time a user approves or rejects, the <span class="ph uicontrol">Approval script</span> is called to determine if the activity should complete.</li></ul> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">When anyone rejects</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 "> <div class="p">A choice between different approval logics to determine which individual rejections result in rejection of the activity's approval. Options are:<ul class="ul" id="r_ApprovalUser__ul_znl_lzz_xs"><li class="li"> <span class="ph uicontrol">Reject the approval:</span> Immediately complete the activity with a result of <span class="ph uicontrol">rejected</span>.</li><li class="li"> <span class="ph uicontrol">Wait for other responses before deciding:</span> Wait until we get other responses before making an approval or rejection decision. This allows users to change their mind until a decision is made.</li></ul> </div> <div class="note"><span class="notetitle">Note:</span> Note that if <span class="ph uicontrol">Wait for</span> is set to <span class="ph uicontrol">Anyone to approve</span> then a single approval will cause the activity to complete with a result of <span class="ph uicontrol">approved</span> even if one or more users reject.</div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Approval Column</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 "> <p class="p">A string field for the name of the approval field on the table the workflow is running on. The default value is <span class="ph uicontrol">approval</span>, which is the field on the Task table.</p> <div class="note"><span class="notetitle">Note:</span> Use the field's name, not its label.<p class="p">If using any custom approval column fields and approval column journals, use Set Value activities in the workflow to set the custom Approval column fields.</p> </div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Approval Journal Column</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 "> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Approval Script</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 "> <div class="p">If the <span class="ph uicontrol">Wait for</span> variable is set to <span class="ph uicontrol">Condition based on script</span> this script is called to determine how to handle an approval or rejection. The script needs to set the variable <var class="keyword varname">answer</var> to approved or rejected to indicate the approval status for this approval. When called, the following information is available:<pre class="pre codeblock"><code> counts.total = total number of users that are part of this approval counts.approved = # of users that approved so far counts.rejected = # of users that rejected so far counts.requested = # of users that are pending approval counts.not_requested = # of users that are not pending approval counts.not_required = # of users that approval is not required</code></pre> </div> </td></tr><tr class="row"><td class="entry cellrowborder subhead" colspan="2" style="vertical-align:top;" headers="d86212e114 d86212e117 ">Approval - User Schedule <p class="p">Specify how workflow calculates the approval record's expected start date and due date. Once you've made a selection for 'Due date based on', and 'Schedule based on', the appropriate fields will display.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Due date based on</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">Select how workflow determines the task's duration, due date, and schedule. <ul class="ul" id="r_ApprovalUser__ul_yxc_4mc_sp"><li class="li"><span class="ph uicontrol">A user specified duration:</span> The duration is based on a user specified value.</li><li class="li"><span class="ph uicontrol">A relative duration:</span> The duration is calculated from a relative duration (such as End of Next Business Day).</li><li class="li"><span class="ph uicontrol">A date/time or duration field:</span> The duration is based on the value of a field on the current record.</li><li class="li"><span class="ph uicontrol">Script:</span> The duration is returned by a script.</li></ul> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Duration <p class="p">Only appears when <span class="ph uicontrol">Due date based on</span> is set to A user specified duration</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">The specific number of days and hours.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Relative duration<p class="p">Only appears when <span class="ph uicontrol">Due date based on</span> is set to A relative duration</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">The general number and length of business days.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Due date field<p class="p">Only appears when <span class="ph uicontrol">Due date based on</span> is set to A date/time or duration field</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">The date/time or duration field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Due date script<p class="p">Only appears when <span class="ph uicontrol">Due date based on</span> is set to Script</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">The script that sets 'answer' to the number of seconds for the duration.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Schedule based on</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">The basic schedule the timer uses to count working hours. If a schedule is specified, the duration will only be considered for times that are specified on the schedule. For example, if the duration is 2 hours and the workflow begins at 4:00pm on a schedule that is 8am - 5pm, then it ends at 9:00am the next day. The options are: <div class="p"><ul class="ul" id="r_ApprovalUser__ul_wys_qhd_lq"><li class="li"><span class="ph uicontrol">This workflow's schedule:</span> The schedule uses workflow context date, time, and an optional <span class="ph uicontrol">Time zone based on</span> value.</li><li class="li"><span class="ph uicontrol">A specific schedule:</span> The schedule uses a pre-defined <span class="ph uicontrol">Schedule</span> and an optional <span class="ph uicontrol">Time zone based on</span> value.</li><li class="li"><span class="ph uicontrol">A schedule field:</span> The schedule uses a value from a table and an optional <span class="ph uicontrol">Time zone based on</span> value.</li></ul> </div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Schedule<p class="p">Only appears when <span class="ph uicontrol">Schedule based on</span> is set to A specific schedule</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">The predefined <span class="ph uicontrol">Schedule</span> from a list.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Schedule field<p class="p">Only appears when <span class="ph uicontrol">Schedule based on</span> is set to A schedule field.</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">A date and time or duration field for the schedule, that is associated with the table. Valid fields appear in blue on the Select the element from a tree dialog.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Time zone based on</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">The time zone for calculating the duration. The time zone may be based on:<ul class="ul" id="r_ApprovalUser__ul_hmv_vhd_lq"><li class="li"><span class="ph uicontrol">No time zone:</span> Default. Workflow uses the GMT time zone.</li><li class="li"><span class="ph uicontrol">A specific time zone:</span> A specific <span class="ph uicontrol">Time zone</span> that you choose from a choice list.</li><li class="li"><span class="ph uicontrol">A time zone field:</span> A <span class="ph uicontrol">Time zone field</span> to track time duration from a field on the form.</li></ul> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Time zone<p class="p">Only appears when <span class="ph uicontrol">Time zone based on</span> is set to A specific time zone</p> .</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">Select the time zone you want from the choice list.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Time zone field<p class="p">Only appears when <span class="ph uicontrol">Time zone based on</span> is set to A time zone field.</p> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">A date and time or duration field for the schedule, that is associated with the table. Valid fields appear in blue on the Select the element from a tree dialog.</td></tr><tr class="row"><td class="entry cellrowborder subhead" colspan="2" style="vertical-align:top;" headers="d86212e114 d86212e117 ">Approval - Advanced <p class="p">If desired, write a script for determining additional users to request approvals from.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Advanced</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 ">Select this check box to write a script for determining additional users to request approvals from.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e114 ">Additional approvers script</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e117 "> <div class="p">If the <span class="ph uicontrol">Advanced</span> check box is selected, this script is called to determine any additional user approvals to be created. The script needs to set the variable <var class="keyword varname">answer</var> to a comma-separated list of user ids and group ids or an array of user and group ids to add as approvers. For example:<pre class="pre codeblock"><code>answer = []; answer.push('id1'); answer.push('id2');</code></pre> </div> </td></tr></tbody></table> </div> </div> <div class="section"><h2 class="title sectiontitle">Conditions</h2> <div class="p">The following conditions determine which transition runs after this activity. <div class="note"><span class="notetitle">Note:</span> <span class="ph">Approval activities run as the user whose actions match the approve or reject conditions the workflow was waiting for and advances the workflow.</span> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_ApprovalUser__table_zgj_ttw_w4" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 2. </span>Approval - User activity conditions</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d86212e649">Condition</th><th class="entry cellrowborder" style="vertical-align:top;" id="d86212e652">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e649 ">Approved</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e652 ">The users approved the request based on the <span class="ph uicontrol">Wait for</span> rules.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e649 ">Rejected</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e652 ">The users rejected the request based on the <span class="ph uicontrol">Wait for</span> rules.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e649 ">Error</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e652 ">The event or condition that generates an error.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e649 ">Skipped</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e652 ">The event or condition that allows a skipped approval.</td></tr></tbody></table> </div> </div> </div> <div class="section"><h2 class="title sectiontitle">States</h2> <div class="p">The activity state tells the workflow engine what to do with the activity. <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_ApprovalUser__table_jr2_15w_w4" class="table" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 3. </span>Approval - User activity states</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d86212e728">State</th><th class="entry cellrowborder" style="vertical-align:top;" id="d86212e731">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e728 ">Executing</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e731 ">The workflow engine starts the <span class="keyword apiname">execute</span> function of the activity.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e728 ">Waiting</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e731 ">The workflow engine ignores the activity until a specific event to restart the activity is fired.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e728 ">Finished</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e731 ">The activity finished running. See the result value for the outcome of the activity.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e728 ">Cancelled</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e731 ">This activity, or the workflow that contains this activity, was canceled.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e728 ">Error</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d86212e731 ">A JavaScript error occurred. Review the logs for error details.</td></tr></tbody></table> </div> </div> </div> </div> <div class="related-links"> <div class="familylinks"> <div class="parentlink"><strong>Parent Topic:</strong> <a class="link" href="../../../administer/workflow-activities/concept/c_ApprovalAndRollbackActivities.html" title="Approval and rollback activities generate and manage approvals.">Approval and rollback workflow activities</a></div> </div> </div></body></html></div>