{"id":183271,"date":"2026-08-13T14:54:31","date_gmt":"2026-08-13T05:54:31","guid":{"rendered":"https:\/\/support.questetra.com\/?p=183271"},"modified":"2026-09-08T12:13:11","modified_gmt":"2026-09-08T03:13:11","slug":"smart-leave-request-workflow","status":"publish","type":"post","link":"https:\/\/support.questetra.com\/en\/developer-blog\/smart-leave-request-workflow\/","title":{"rendered":"Building a Leave Request Workflow with Scripts (Overview)"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"58\" data-attachment-id=\"113212\" data-permalink=\"https:\/\/support.questetra.com\/en\/developer-blog\/message-start-event-http-browser\/attachment\/professional-banner-new-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/12\/professional-banner-new-en.png?fit=1200%2C68&amp;ssl=1\" data-orig-size=\"1200,68\" data-comments-opened=\"0\" data-image-title=\"professional-banner-new-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/12\/professional-banner-new-en.png?fit=1024%2C58&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/12\/professional-banner-new-en-1024x58.png?resize=1024%2C58&#038;ssl=1\" alt=\"\" class=\"wp-image-113212\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/12\/professional-banner-new-en.png?resize=1024%2C58&amp;ssl=1 1024w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/12\/professional-banner-new-en.png?resize=600%2C34&amp;ssl=1 600w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/12\/professional-banner-new-en.png?resize=768%2C44&amp;ssl=1 768w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/12\/professional-banner-new-en.png?w=1200&amp;ssl=1 1200w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When designing workflows, it\u2019s easy to focus on simply connecting steps: request \u2192 approve \u2192 done. But in practice, even a simple process like leave requests can create complications:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Managers approve requests that later turn out to be problematic<\/li>\n\n\n\n<li>Team schedules become unbalanced<\/li>\n\n\n\n<li>Back-and-forth increases when dates need to be changed<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, a <strong>\u201csmart\u201d leave request workflow<\/strong> in Questetra BPM Suite is presented\u2014using standard BPMN icons and a small amount of coding\u2014to reduce these issues before they occur.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The core principle is as follows:<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Complex logic is not required for a functional workflow; rather, necessary checks must be performed at appropriate intervals.<\/p>\n\n\n\n<hr class=\"wp-block-separator alignwide has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Goal of a Smart Leave Workflow<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Beyond simple collection and approval, the following objectives are prioritized:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Prevent invalid or problematic requests early<\/li>\n\n\n\n<li>Reduce unnecessary manual checks<\/li>\n\n\n\n<li>Handle delays automatically<\/li>\n\n\n\n<li>Keep the process simple for users<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<hr class=\"wp-block-separator alignwide has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Overview of the Workflow<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The overall structure is defined as follows:<br><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Human Task: <\/strong>Enter Leave Details<\/li>\n\n\n\n<li><strong>Script Task: <\/strong>Check Calendar Availability<\/li>\n\n\n\n<li><strong>Exclusive Gateway: <\/strong>Is the Date Available?<\/li>\n\n\n\n<li><strong>Human Task: <\/strong>Manager Approval<\/li>\n\n\n\n<li><strong>Timer Boundary Event: <\/strong>Escalation<\/li>\n\n\n\n<li><strong>Google Calendar: Insert Event \/ Throwing Message Intermediate Event (email)<\/strong>: Updates and Notifications<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"911\" height=\"630\" data-attachment-id=\"183524\" data-permalink=\"https:\/\/support.questetra.com\/en\/developer-blog\/smart-leave-request-workflow\/attachment\/smart-leave-request-workflow-1-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-1-en.png?fit=943%2C652&amp;ssl=1\" data-orig-size=\"943,652\" data-comments-opened=\"0\" data-image-title=\"smart-leave-request-workflow-1-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-1-en.png?fit=911%2C630&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-1-en-911x630.png?resize=911%2C630&#038;ssl=1\" alt=\"\" class=\"wp-image-183524\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-1-en.png?resize=911%2C630&amp;ssl=1 911w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-1-en.png?resize=456%2C315&amp;ssl=1 456w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-1-en.png?resize=768%2C531&amp;ssl=1 768w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-1-en.png?w=943&amp;ssl=1 943w\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Each step is analyzed from a design perspective below.<\/p>\n\n\n\n<hr class=\"wp-block-separator alignwide has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. Human Task \u2013 Capturing the Right Information<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The first step is a <strong>Human Task<\/strong> where the requester fills in the required details.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Typical inputs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Leave dates<\/li>\n\n\n\n<li>Reason<\/li>\n\n\n\n<li>Backup contact<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Design tip:<\/strong> Keep the form simple. The easier it is to submit, the more consistently the app will be used.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"555\" data-attachment-id=\"183540\" data-permalink=\"https:\/\/support.questetra.com\/en\/developer-blog\/smart-leave-request-workflow\/attachment\/smart-leave-request-workflow-2-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-2-en.png?fit=802%2C555&amp;ssl=1\" data-orig-size=\"802,555\" data-comments-opened=\"0\" data-image-title=\"smart-leave-request-workflow-2-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-2-en.png?fit=802%2C555&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-2-en.png?resize=802%2C555&#038;ssl=1\" alt=\"\" class=\"has-border-color has-ast-global-color-8-border-color wp-image-183540\" style=\"border-width:5px;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-left-radius:5px;border-bottom-right-radius:5px\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-2-en.png?w=802&amp;ssl=1 802w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-2-en.png?resize=455%2C315&amp;ssl=1 455w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-2-en.png?resize=768%2C531&amp;ssl=1 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The following standard should be observed:<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Effective workflows ensure the collection of accurate data at the onset of the process.<\/p>\n\n\n\n<hr class=\"wp-block-separator alignwide has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Script Task \u2013 Checking Calendar Availability<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This is where the workflow becomes \u201csmart\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of waiting for a manager to manually check schedules, an <strong>Auto Step (Script Task)<\/strong> can be inserted to check whether the requested date is already heavily booked.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What this step does:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Looks at the requested date<\/li>\n\n\n\n<li>Checks a calendar system (in this case Google Calendar)<\/li>\n\n\n\n<li>Determines whether the date is \u201cfull\u201d or still available<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Implementation Note<\/strong>: As a dedicated BPMN icon for calendar verification does not exist, a Script Task is utilized to invoke an external service and evaluate availability.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Technical details regarding the Script Task may be referenced in the provided code block below.<\/p>\n\n\n\n<div class=\"wp-block-coblocks-accordion\">\n<div class=\"wp-block-coblocks-accordion-item\"><details><summary class=\"wp-block-coblocks-accordion-item__title\">Script (click to open)<\/summary><div class=\"wp-block-coblocks-accordion-item__content\">\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\n\/*\n * Questetra Script Task\n * Check whether the requested leave period overlaps with existing Google Calendar events\n *\n * Input:\n *   q_start_date   (Date)\n *   q_end_date     (Date)\n *\n * Output:\n *   q_availability (Select, single choice)\n *     - option ID: YES\n *     - option ID: NO\n *\n * Important:\n * - Replace CALENDAR_ID\n * - Replace ACCESS_TOKEN retrieval with your real method\n * - This assumes the Select item q_availability has option IDs exactly &quot;YES&quot; and &quot;NO&quot;\n *\/\n\nconst CALENDAR_ID = &quot;YOUR CALENDAR ID&quot;;\n\n\/\/ 1) Read dates from workflow data items\nconst startDate = engine.findDataByVarName(&quot;q_start_date&quot;);\nconst endDate   = engine.findDataByVarName(&quot;q_end_date&quot;);\n\nif (startDate === null || endDate === null) {\n  throw new Error(&quot;q_start_date or q_end_date is empty.&quot;);\n}\n\n\/\/ 2) Build an inclusive date-time range\n\/\/    Start at 00:00:00 of start date\n\/\/    End at 23:59:59 of end date\nconst timeMin = startDate.toString() + &quot;T00:00:00+09:00&quot;;\nconst timeMax = endDate.toString()   + &quot;T23:59:59+09:00&quot;;\n\n\/\/ 3) Build Google Calendar Events API request\nconst url =\n  &quot;https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/&quot; +\n  encodeURIComponent(CALENDAR_ID) +\n  &quot;\/events&quot;;\n\n\nlet request = httpClient.begin();\nrequest = request.authSetting(&quot;YOUR APP NAME&quot;);\nrequest = request.queryParam(&quot;timeMin&quot;, timeMin);\nrequest = request.queryParam(&quot;timeMax&quot;, timeMax);\nrequest = request.queryParam(&quot;singleEvents&quot;, &quot;true&quot;);\nrequest = request.queryParam(&quot;orderBy&quot;, &quot;startTime&quot;);\n\nconst response = request.get(url);\nconst status = response.getStatusCode() + &quot;&quot;;\nconst body = response.getResponseAsString() + &quot;&quot;;\n\nengine.log(&quot;Calendar check status: &quot; + status);\n\nif (status !== &quot;200&quot;) {\n  throw new Error(&quot;Google Calendar API error: &quot; + status + &quot;\\n&quot; + body);\n}\n\n\/\/ 4) Parse response\nconst json = JSON.parse(body);\nconst events = json.items || [];\n\n\/\/ 5) Decide availability\n\/\/    If any event exists in the requested period, mark as NO\nconst availableFlag = (events.length === 0) ? &quot;YES&quot; : &quot;NO&quot;;\n\n\/\/ 6) Save to Select-type data item q_availability\nconst result = new java.util.ArrayList();\nresult.add(availableFlag);\nengine.setDataByVarName(&quot;q_availability&quot;, result);\n\nengine.log(&quot;Leave availability: &quot; + availableFlag);\nengine.log(&quot;Events found: &quot; + events.length);\n\n\n<\/code><\/pre><\/div>\n<\/div><\/details><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Functional code can be generated by AI to meet specific requirements, facilitating complex automation for workflow designers.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. Exclusive Gateway \u2013 Is the Date Available?<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Following the Auto Task, an Exclusive Gateway (XOR-Split) is used to branch the workflow based on date availability:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Date available<\/strong> \u2192 proceed to approval<\/li>\n\n\n\n<li><strong>Date full<\/strong> \u2192 return to requester<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"127\" data-attachment-id=\"183578\" data-permalink=\"https:\/\/support.questetra.com\/en\/developer-blog\/smart-leave-request-workflow\/attachment\/smart-leave-request-workflow-3-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-3-en.png?fit=868%2C127&amp;ssl=1\" data-orig-size=\"868,127\" data-comments-opened=\"0\" data-image-title=\"smart-leave-request-workflow-3-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-3-en.png?fit=868%2C127&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-3-en.png?resize=868%2C127&#038;ssl=1\" alt=\"\" class=\"has-border-color wp-image-183578\" style=\"border-color:var(--ast-global-color-8);border-width:5px;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-left-radius:5px;border-bottom-right-radius:5px\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-3-en.png?w=868&amp;ssl=1 868w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-3-en.png?resize=600%2C88&amp;ssl=1 600w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-3-en.png?resize=768%2C112&amp;ssl=1 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The following design principle is applied:<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Workflow intelligence is maximized when decisions are executed early in the process.<\/p>\n\n\n\n<p class=\"has-very-light-gray-background-color has-background wp-block-paragraph\"><strong>Note<\/strong>: following the Gateway there is an [<a href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-data-assignment\/\">Update Data<\/a>] step called &#8220;Update Datetime&#8221;. This simply converts the dates input in the &#8220;Start Date&#8221; and End Date&#8221; fields into Datetime-type data items, which allows them to be selected later in the workflow in the [<a href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/googlecalendar-insertevent\/\">Google Calendar: Insert Event<\/a>] steps. This is necessary to allow the approved request to be inserted into the external calendar. <\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>4. Human Task \u2013 Manager Approval<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If the date is valid, the request moves to a <strong>Manager Approval (Human Task)<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At this point:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Focus is placed on decision-making rather than data validation<\/li>\n\n\n\n<li>The process is faster and cleaner<\/li>\n<\/ul>\n\n\n\n<p class=\"has-very-light-gray-background-color has-background wp-block-paragraph\"><strong>Design insight:<\/strong> The cognitive load on approvers is reduced by the early filtering of problematic requests.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>5. Timer Boundary Event \u2013 Handling Delays Automatically<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Delays are frequently encountered in approval workflows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A <strong>Timer Boundary Event<\/strong> is attached to the approval task to address this:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If the manager doesn\u2019t respond within a set time (e.g. 2 days)<br>\u2192 Automatically escalate to another approver (in this case the Department Head)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Utilizing this approach transforms the workflow to be:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Highly dependable<\/li>\n\n\n\n<li>Resilient against individual bottlenecks<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">An <strong>Error Boundary Event<\/strong> can also be configured to escalate the task if no eligible user is available.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>6. Auto Steps \u2013 Updates and Notifications<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Upon approval, a <strong>Google Calendar: Insert Event<\/strong> is executed to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Update a calendar using the dates input by the requester<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Meanwhile, a <strong>Throwing Message Intermediate Event (email)<\/strong> is used to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Send confirmation emails<\/li>\n\n\n\n<li>Notify relevant team members<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These system-level responsibilities are ideal for Auto Steps.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The workflow concludes either with the scheduling of the approved leave or the rejection of the request.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What Makes This Workflow \u201cSmart\u201d?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In spite of the simplicity, significant improvements are introduced by this design:<\/p>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>1. Problems are caught early<\/strong><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">Calendar conflicts are detected before approval<\/p>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>2. Manual work is reduced<\/strong><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">Manual availability checks by managers are eliminated.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>3. Delays are handled automatically<\/strong><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">Progress is ensured through automated escalation.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>4. The process stays user-friendly<\/strong><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">No additional burden is placed on employees.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Key Takeaway for Workflow Designers<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">During the design phase, it was noted that a specific BPMN icon for calendar verification is unavailable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">BPMN focuses on the modeling of <strong>responsibility<\/strong> rather than specific actions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Human Tasks<\/strong> represent points where actions or decisions are performed by personnel<\/li>\n\n\n\n<li><strong>Auto Tasks<\/strong> represent points where functions or logic are applied by the system<\/li>\n\n\n\n<li><strong>Gateways<\/strong> control the case flow based on the outcomes of these steps<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In this workflow, the availability check is performed via a Script Task, where requested dates are evaluated against defined criteria. The Gateway then routes the process accordingly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a workflow designer, importance is placed on defining where decisions are made, identifying responsible entities, and determining the subsequent process flow.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Workflow optimization is achievable through simple design changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Business processes like leave requests are improved by the strategic placement of Auto Steps and the careful analysis of decision points.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conclusion:<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">These improvements are accessible to workflow designers without extensive technical expertise.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Detailed information regarding Auto Tasks, Script Tasks, and API integrations may be found in the associated developer blog series.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Articles in This Series<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Building a Leave Request Workflow with Scripts (Overview) (this article)<\/li>\n\n\n\n<li><a href=\"https:\/\/support.questetra.com\/en\/developer-blog\/debugging-leave-request-flow\/\">Building a Leave Request Workflow with Scripts (Calendar Verification)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/support.questetra.com\/en\/developer-blog\/auto-suggest-alt-leave-dates\/\">Building a Leave Request Workflow with Scripts (Alternative Date Suggestion)<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I\u2019ll walk through how to design a smart Leave Request Workflow, using standard BPMN icons and a small amount of coding,  that leaves menial checks to auto steps so that users can focus on the most important decisions. <\/p>\n","protected":false},"author":30,"featured_media":183284,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_uag_custom_page_level_css":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","jetpack_seo_llms_txt_always_include":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[296],"tags":[],"faq_section":[],"class_list":["post-183271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer-blog"],"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?fit=1672%2C941&ssl=1",1672,941,false],"thumbnail":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=440%2C440&ssl=1",440,440,true],"medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?fit=560%2C315&ssl=1",560,315,true],"medium_large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?fit=768%2C432&ssl=1",768,432,true],"large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?fit=1024%2C576&ssl=1",1024,576,true],"1536x1536":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?fit=1536%2C864&ssl=1",1536,864,true],"2048x2048":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?fit=1672%2C941&ssl=1",1672,941,true],"newspack-article-block-landscape-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=1200%2C900&ssl=1",1200,900,true],"newspack-article-block-portrait-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=900%2C941&ssl=1",900,941,true],"newspack-article-block-square-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=1200%2C941&ssl=1",1200,941,true],"newspack-article-block-landscape-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=800%2C600&ssl=1",800,600,true],"newspack-article-block-portrait-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=600%2C800&ssl=1",600,800,true],"newspack-article-block-square-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=800%2C800&ssl=1",800,800,true],"newspack-article-block-landscape-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=600%2C450&ssl=1",600,450,true],"newspack-article-block-portrait-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=450%2C600&ssl=1",450,600,true],"newspack-article-block-square-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=600%2C600&ssl=1",600,600,true],"newspack-article-block-landscape-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=400%2C300&ssl=1",400,300,true],"newspack-article-block-portrait-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=300%2C400&ssl=1",300,400,true],"newspack-article-block-square-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=400%2C400&ssl=1",400,400,true],"newspack-article-block-landscape-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=200%2C150&ssl=1",200,150,true],"newspack-article-block-portrait-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=150%2C200&ssl=1",150,200,true],"newspack-article-block-square-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?resize=200%2C200&ssl=1",200,200,true],"newspack-article-block-uncropped":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?fit=1200%2C675&ssl=1",1200,675,true]},"uagb_author_info":{"display_name":"Peter Glover","author_link":"https:\/\/support.questetra.com\/en\/author\/petergloverquestetra\/"},"uagb_comment_info":0,"uagb_excerpt":"In this article, I\u2019ll walk through how to design a smart Leave Request Workflow, using standard BPMN icons and a small amount of coding, that leaves menial checks to auto steps so that users can focus on the most important decisions.","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9DiIh-LFZ","jetpack-related-posts":[{"id":74763,"url":"https:\/\/support.questetra.com\/en\/developer-blog\/google-drive-items\/","url_meta":{"origin":183271,"position":0},"title":"Utilizing Google Drive from Workflow &#8211; Sending files to people outside the company","author":"Hirotaka NISHI","date":"2020-10-30","format":false,"excerpt":"Google Drive is a cloud storage service offered by Google. I will explain automatic Step for utilizing Google Drive in a Workflow App.","rel":"","context":"In \"Google Drive API v3\"","block_context":{"text":"Google Drive API v3","link":"https:\/\/support.questetra.com\/ja\/tag\/google-drive-api-v3\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/google-drive-questetra.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/google-drive-questetra.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/google-drive-questetra.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/google-drive-questetra.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/google-drive-questetra.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":73811,"url":"https:\/\/support.questetra.com\/en\/developer-blog\/message-start-event-http-curl\/","url_meta":{"origin":183271,"position":1},"title":"Starting a Case from Outside of Questetra BPM Suite (curl Chapter)","author":"Hirotaka NISHI","date":"2019-01-04","format":false,"excerpt":"Introducing how to access the Message Start Event (HTTP) API from the curl command. This allows Starting a Case from the command shell.","rel":"","context":"In &quot;Questetra Developers Blog&quot;","block_context":{"text":"Questetra Developers Blog","link":"https:\/\/support.questetra.com\/en\/category\/developer-blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":82721,"url":"https:\/\/support.questetra.com\/en\/developer-blog\/service-task-calculation-datetime\/","url_meta":{"origin":183271,"position":2},"title":"Let\u2019s Set a Deadline","author":"Peter Glover","date":"2021-10-07","format":false,"excerpt":"How to set the date and time when a Task will occur, and the deadline date when it must be completed.","rel":"","context":"In &quot;Questetra Developers Blog&quot;","block_context":{"text":"Questetra Developers Blog","link":"https:\/\/support.questetra.com\/en\/category\/developer-blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/04\/eye-catch-update_data-deadline-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/04\/eye-catch-update_data-deadline-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/04\/eye-catch-update_data-deadline-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/04\/eye-catch-update_data-deadline-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/04\/eye-catch-update_data-deadline-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":76130,"url":"https:\/\/support.questetra.com\/en\/bpmn-icons\/message-start-event-http\/","url_meta":{"origin":183271,"position":3},"title":"Message Start Event (HTTP)","author":"Hirotaka NISHI","date":"2019-04-05","format":false,"excerpt":"Issues a URL that awaits an HTTP request. Starts a new Process automatically when an HTTP request is received. Capable of inserting values accepted as receive parameters to Business Data.","rel":"","context":"In &quot;BPMN\u30a2\u30a4\u30b3\u30f3&quot;","block_context":{"text":"BPMN\u30a2\u30a4\u30b3\u30f3","link":"https:\/\/support.questetra.com\/ja\/category\/bpmn-icons\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/10\/bpmn-icon-message-start-event-http-1200x675.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/10\/bpmn-icon-message-start-event-http-1200x675.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/10\/bpmn-icon-message-start-event-http-1200x675.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/10\/bpmn-icon-message-start-event-http-1200x675.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/10\/bpmn-icon-message-start-event-http-1200x675.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":73584,"url":"https:\/\/support.questetra.com\/en\/developer-blog\/message-start-event-http-browser\/","url_meta":{"origin":183271,"position":4},"title":"Starting a Case from Outside of Questetra BPM Suite (Preparatory Chapter)","author":"Hirotaka NISHI","date":"2018-12-13","format":false,"excerpt":"Questetra BPM Suite has a feature to Start a Process by an HTTP request from external systems. I will show you how to use this \"Message Start Event (HTTP)\" which is useful for advancing intersystem cooperation. In this post, I will focus mainly on setting on the Workflow App side.","rel":"","context":"In &quot;Questetra Developers Blog&quot;","block_context":{"text":"Questetra Developers Blog","link":"https:\/\/support.questetra.com\/en\/category\/developer-blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/09\/external-start-en-fi.jpg?fit=1200%2C655&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":87741,"url":"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-throwing-message-to-start-event\/","url_meta":{"origin":183271,"position":5},"title":"Service Task (Start Child Case)","author":"Peter Glover","date":"2023-04-19","format":false,"excerpt":"An automatic step that sends an HTTP request to Message Start Event (HTTP) on the same workflow platform. You can easily establish an inter-app connection simply by setting the send data. When a workflow App including Message Start Event (HTTP) is released, the corresponding Service Task is automatically generated.","rel":"","context":"In &quot;BPMN\u30a2\u30a4\u30b3\u30f3&quot;","block_context":{"text":"BPMN\u30a2\u30a4\u30b3\u30f3","link":"https:\/\/support.questetra.com\/ja\/category\/bpmn-icons\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/05\/bpmn-icon-service-task-throwing-message-to-start-event.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/05\/bpmn-icon-service-task-throwing-message-to-start-event.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/05\/bpmn-icon-service-task-throwing-message-to-start-event.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/05\/bpmn-icon-service-task-throwing-message-to-start-event.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/05\/bpmn-icon-service-task-throwing-message-to-start-event.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2026\/04\/smart-leave-request-workflow-fi-en.png?fit=1672%2C941&ssl=1","_links":{"self":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/183271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/comments?post=183271"}],"version-history":[{"count":60,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/183271\/revisions"}],"predecessor-version":[{"id":194839,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/183271\/revisions\/194839"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/media\/183284"}],"wp:attachment":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/media?parent=183271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/categories?post=183271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/tags?post=183271"},{"taxonomy":"faq_section","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/faq_section?post=183271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}