<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rahul Sahu on Medium]]></title>
        <description><![CDATA[Stories by Rahul Sahu on Medium]]></description>
        <link>https://medium.com/@sahu.rahul2512?source=rss-573aed58049b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_pl01tRbCc_vAFC1k1qHOQ.gif</url>
            <title>Stories by Rahul Sahu on Medium</title>
            <link>https://medium.com/@sahu.rahul2512?source=rss-573aed58049b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:40:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sahu.rahul2512/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Reliable Retry Mechanism for Consumed APIs in OutSystems]]></title>
            <link>https://medium.com/@sahu.rahul2512/building-a-reliable-retry-mechanism-for-consumed-apis-in-outsystems-ed4ac225f785?source=rss-573aed58049b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed4ac225f785</guid>
            <dc:creator><![CDATA[Rahul Sahu]]></dc:creator>
            <pubDate>Fri, 21 Aug 2026 09:57:54 GMT</pubDate>
            <atom:updated>2026-08-21T09:57:54.290Z</atom:updated>
            <content:encoded><![CDATA[<h3>How we handle failed integration calls without losing data or waking up at 2 AM</h3><p>When you’re integrating a low-code app with an external system — a CRM, a dialer platform, a notification service — the one guarantee you <em>don’t</em> get is that the API will always respond the way you expect. Networks drop. Downstream services time out. Rate limits kick in at the worst possible moment.</p><p>The question isn’t <em>if</em> a Consumed API call will fail. It’s <em>what happens next</em>.</p><p>Here’s the retry mechanism we built to make sure a failed call is never a lost call.</p><h3>The Problem</h3><p>We had a Consumed API integration (an Opportunity/CRM sync via a dialer platform) that occasionally failed — a timeout here, a 5xx there. The original design just logged the error and moved on. That meant:</p><ul><li>Every failure needed manual investigation.</li><li>There was no record of <em>what</em> was sent, so replaying it meant reconstructing the payload from scratch.</li><li>Nothing retried automatically, so small blips turned into missed records.</li></ul><p>The fix: persist the failure with everything needed to replay it, and let a scheduled process clean up the backlog on its own.</p><h3>The Design: RetryQueue</h3><p>At the center of this is a single entity — <strong>RetryQueue</strong> — that stores one record per failed API call, including the exact request that was sent and the response that came back.</p><p>Key attributes:</p><p>Attribute And Purpose<br>RequestJson -The exact payload sent to the API — reused as-is when retrying<br>ResponseJson / What the API returned on the last attempt</p><p>StatusCode -What the API returned on the last attempt<br>IsSuccessFalse- until a retry succeedsRetryCountHow many attempts have been made<br>IsActive-Whether this record is still eligible for retry<br>RetrySkippedReason-Why a record stopped retrying (e.g. max attempts hit)<br><em>RecordID — Main recordID</em></p><p>Because RequestJson is captured at the moment of the original failure, the retry process never has to <em>rebuild</em> the payload — it just resends exactly what was sent before.</p><h3>Step 1: Capture the Failure</h3><p>Whenever the Consumed API call fails — non-success status code, exception, or timeout — instead of just logging it, we create a RetryQueue record:</p><pre>IsSuccess = False<br>RetryCount = 0<br>IsActive = True<br>RequestJson = &lt;exact payload sent&gt;<br>ResponseJson / StatusCode = &lt;what came back, or error details&gt;</pre><p>The business transaction doesn’t have to fail just because the integration did. The user’s action completes; the sync happens in the background.</p><h3>Step 2: A Timer Cleans Up the Backlog</h3><p>A scheduled Timer — running every <strong>30 minutes</strong> (configurable) — picks up unresolved records and retries them:</p><pre>For each eligible RetryQueue record:<br>    Resend RequestJson to the Consumed API</pre><pre>    If successful:<br>        IsSuccess = True<br>        Update ResponseJson / StatusCode</pre><pre>    If still failing:<br>        RetryCount = RetryCount + 1<br>        Update ResponseJson / StatusCode</pre><pre>        If RetryCount &gt;= MaxRetryCount:<br>            IsActive = False<br>            RetrySkippedReason = &quot;Max retry attempts exceeded&quot;</pre><p>No manual replay, no rebuilding requests — the timer just works through the queue.</p><h3>Step 3: The Selection Query</h3><p>The one condition the whole mechanism hinges on:</p><p>sql</p><pre>IsSuccess = False<br>AND IsActive = True<br>AND RetryCount &lt; ConfiguredMaxRetryCount</pre><p>n OutSystems, that’s an Aggregate filter:</p><pre>RetryQueue.IsSuccess = False<br>and RetryQueue.IsActive = True<br>and RetryQueue.RetryCount &lt; GetRetryQueueMaxAttempts()</pre><p>GetRetryQueueMaxAttempts() pulls from a Site Property, so the retry limit — and the timer interval — can be tuned per environment without a redeploy.</p><h3>Why This Works Well in Practice</h3><ul><li><strong>Nothing gets silently dropped.</strong> Every failure is a row, not a log line.</li><li><strong>Retries are cheap.</strong> The original request is stored, so replaying it is a single API call, not a rebuild.</li><li><strong>It self-limits.</strong> Once a record hits the max retry count, it stops consuming timer cycles and gets flagged for manual review instead.</li><li><strong>It’s tunable without touching code.</strong> Interval and max attempts are both Site Properties.</li></ul><p>A few things worth considering if you’re building something similar:</p><ul><li>Keep the timer’s batch size bounded (e.g., top N by CreatedOn) so one run doesn&#39;t turn into a long-running job.</li><li>If the downstream API is rate-limited, consider a simple backoff — skip a record if it was just updated within the last few minutes.</li><li>Log every attempt’s response, even failures — it makes debugging patterns (a specific location, a specific error code) much easier later.</li></ul><p><em>A small mechanism, but it’s the difference between “the integration failed” being an incident and it being a non-event.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed4ac225f785" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to schedule timer or provide functionality end user to schedule timers]]></title>
            <link>https://medium.com/@sahu.rahul2512/how-to-schedule-timer-or-provide-functionality-end-user-to-schedule-timers-ca71f2e76e46?source=rss-573aed58049b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca71f2e76e46</guid>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[end-user-support]]></category>
            <category><![CDATA[outsystems]]></category>
            <category><![CDATA[timer]]></category>
            <category><![CDATA[dynamics]]></category>
            <dc:creator><![CDATA[Rahul Sahu]]></dc:creator>
            <pubDate>Wed, 12 Jul 2023 10:49:26 GMT</pubDate>
            <atom:updated>2023-07-12T10:54:57.174Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Timer</strong></p><p><em>A Timer is an OutSystems tool that allows executing application logic periodically on a scheduled time. These are also known as batch jobs.</em></p><p><em>Different Timers can be executed at the same time, but the same Timer never has more than one execution at a time.</em></p><p><strong>Runtime and Log databases</strong></p><p><em>This section describes the database entities that support Timers and their functionality.</em></p><p><strong><em>Entity Meta_Cyclic_Job</em></strong></p><p><em>This entity contains the definitions of Timers created in modules which are stored in records in the </em><strong><em>ossys_Meta_Cyclic_Job</em></strong><em> database table. These records are created and managed by OutSystems and the </em><strong><em>Effective_Timeout</em></strong><em> is the only attribute that you can change.</em></p><p><strong><em>Entity Cyclic_Job/Cyclic_Job_Shared</em></strong></p><p><em>Cyclic_Job contains the information about all Timers to be executed by the Scheduler Service in multi-tenant modules. You can browse this information in Service Center (see </em><a href="https://success.outsystems.com/documentation/11/reference/outsystems_language/processes/timer/#monitor-timers"><em>Monitoring the execution of Timers</em></a><em>).</em></p><p><em>As there may be multiple Front-end Server nodes executing Timers, each with its own time, the time reference for executing Timers is always the database clock.</em></p><p><em>Records of this entity are stored in the database in the ossys_Cyclic_Job table. They’re created and managed by OutSystems.</em></p><p><em>The Schedule and Next_Run are the only attributes of this entity that you can change. However, don’t set them when the Timer is being executed, which can be verified by checking the value in the Is_Running_Since attribute:</em></p><p><em>· If set: the Timer is running.</em></p><p><em>· If not set: the Timer isn’t running.</em></p><p><strong><em>Cyclic_Job_Shared entity contains the information of Timers to be executed by the Scheduler Service in single-tenant modules.</em></strong></p><p><strong>How you can schedule dynamically or programmatically</strong></p><p><em>1. Create a Static Entity to check Status “JobStatus”</em></p><p><em>Like below –</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*RaX6dayJXZ1leyLgKP3cMw.png" /></figure><p><em>2. Create another entity with help of Meta_Cyclic_Job Identifier “Jobs”</em></p><p><em>Like Below-</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*w4mIOa2JKrSptMVsqFnlIw.png" /></figure><p><em>Added a attribute like GUID will help you to identify unique record.</em></p><p><em>3. Now create server action which help to identify Next and Last Run of timer and First time schedule if not</em>.</p><p><strong><em>GetNextRun</em></strong><em> Action</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JA4mG8oqzCF9M3i9BtUqBg.png" /></figure><p><strong><em>GetJobs</em></strong><em> Aggregate will fetch the record depending on Schedule Date Ascending order.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_a0OxGt-EKQxZ1sxC3jo-w.png" /></figure><p><em>After that get record from Cyclic_job_shared by Meta_Cylic_job and update the record and set next run property.</em></p><p><em>Set GUID in scheduled attribute that will help you to identify which record you need to update.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_x9mf2okkD0Ls2bcKHrYwQ.png" /></figure><p><em>Once it complete update the current record as scheduled so we can understand job status.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDfHFxQQMRPAknFen-v4lw.png" /></figure><p><strong><em>GetLastRun</em></strong><em> Action with input parameter GUID</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DF1bdfyisBN2JiKIWOO8sg.png" /></figure><p><em>Fetch jobs by GUID and check if it is not empty update this record as completed job status and IsRun attribute True.</em></p><p><em>4. ScheduleFirstTimeJob Action with input parameter Meta_Cyclic_Job_Id</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHA5qD_if_b9ArviLv_n3Q.png" /></figure><p><em>Fetch the record from Cyclic_Job_Shared and Meta_cyclic_job entity only with joins.If it is return any record check inside if condition –</em></p><p><strong><em>GetMetaCyclicJobById.List.Current.Cyclic_Job_Shared.Next_Run = TextToDateTime(“3000–01–01 00:00:00”)</em></strong></p><p><em>This condition will check the timer is schedule or not if not schedule then call next run according else leave it.</em></p><p><em>5. Now Create a timer in application like below</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*ld746W0V4xOgjZrCDS2tFA.png" /></figure><p><em>For this timer create a action according to business need here we are creating Generate Report with Timer Name input variables Action.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y8esDoliqC1ZTkgS2TTPDg.png" /></figure><p><em>Fetch the record from Meta_Cyclic_job and Cyclic_Job_Shared entity as below image.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y8esDoliqC1ZTkgS2TTPDg.png" /></figure><p><em>In </em><strong><em>GetLastRun</em></strong><em> have one input parameter with GUID pass the value from </em><strong><em>Cyclic_Job_Shared</em></strong><em> Entity Schedule Attribute value.</em></p><p><em>6. Now Create a screen to insert record inside jobs entity.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qzItAJ0cR1nddZqKhh4GGg.png" /></figure><p><em>When you save the record follow below points.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-YZdpKZVl_fRDrl9dF4Lg.png" /></figure><ol><li><em>Check the current value should not match with previous record.</em></li><li><em>Schedule date time should be unique and cannot be past time else provide to message.</em></li><li><strong><em>GenerateGUID</em></strong><em> and assign in attributes.</em></li><li><em>First time Job Status should be </em><strong><em>InProcess</em></strong><em>.</em></li><li><em>At the last call </em><strong><em>ScheduleFirstTimeJob</em></strong><em> Action.</em></li><li><em>Now publish the application and the test it. Whenever you create job, it depending on time the timer will call.</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca71f2e76e46" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>