<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged github-api</title>
<link>https://coderlegion.com/tag/github-api</link>
<description>Powered by Question2Answer</description>
<item>
<title>Deferring Publication After a Budget-Safe Draft Revision</title>
<link>https://coderlegion.com/31317/deferring-publication-after-a-budget-safe-draft-revision</link>
<description>&lt;p&gt;A Cloudflare Workflow can spend most of its bounded external request budget before publication begins, risking partial failures when generation and publishing share a single run.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Quick solution:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;if (!hasPublicationBudget) {
  await commitDraftOnly(revisionData);
  return { promotionDeferred: true, readyPath: revisionData.path };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Reserving candidate commit, promotion preflight, live checks, site writes, and vault finalization before model calls prevents generation from creating a draft that the same run cannot safely publish. When an explicit revision-only run cannot reserve the full tail, retain only the five-request draft commit reserve.&lt;/p&gt;
&lt;h3 id=&quot;understanding-the-request-budget-conflict&quot;&gt;Understanding the Request Budget Conflict&lt;/h3&gt;
&lt;p&gt;Cloudflare documents strict subrequest ceilings on its free plan, while GitHub documents base tree writes for atomic tree changes via REST API endpoints for Git trees as outlined in the &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.github.com/en/rest/git/trees&quot;&gt;GitHub REST API Git trees documentation&lt;/a&gt;. When a workflow handles candidate commits, promotion preflights, and final vault writes, it can exhaust its budget before publishing.&lt;/p&gt;
&lt;p&gt;For more details on platform limits, consult the &lt;a rel=&quot;nofollow&quot; href=&quot;https://developers.cloudflare.com/workflows/reference/limits/&quot;&gt;Cloudflare Workflows limits documentation&lt;/a&gt;. The five-request commit budget and the later publish-only step are application safeguards rather than limits specified by either provider. For related architectural guidance, you can also review &lt;a rel=&quot;nofollow&quot; href=&quot;https://raylabs.app/articles/managing-concurrent-git-commits-during-automated-publishing/&quot;&gt;Managing Concurrent Git Commits During Automated Publishing&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;implementing-a-deferred-publication-fallback&quot;&gt;Implementing a Deferred Publication Fallback&lt;/h3&gt;
&lt;p&gt;When a revision-only repair occurs, you have a different recovery option available. Instead of failing the entire run, commit the reviewed revision and promote that exact ready draft in a later run.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Keep the full publication reserve unchanged for normal candidates and same-run promotion.&lt;/li&gt;
&lt;li&gt;When an explicit revision-only run cannot reserve the full tail, retain only the five-request draft commit reserve.&lt;/li&gt;
&lt;li&gt;Generate and review the revision, commit its Markdown, quality record, and raster metadata, then return the resulting ready-draft path with an explicit deferred publication result.&lt;/li&gt;
&lt;li&gt;Skip publication selection in that run. After it completes, use a separate publish-only run scoped to the exact ready-draft path.&lt;/li&gt;
&lt;li&gt;Keep manual live runs serial so a second workflow cannot race the vault SHA guard.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;verification-and-execution-checklist&quot;&gt;Verification and Execution Checklist&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Verify the five-request reserve constraint during low-budget execution.&lt;/li&gt;
&lt;li&gt;Confirm generation and commit succeed after the full publication reserve fails.&lt;/li&gt;
&lt;li&gt;Validate that the exact-path deferred result is correctly returned.&lt;/li&gt;
&lt;li&gt;Ensure manual live runs remain serial to prevent race conditions on the vault SHA guard.&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/31317/deferring-publication-after-a-budget-safe-draft-revision</guid>
<pubDate>Fri, 16 Oct 2026 08:38:28 +0000</pubDate>
</item>
</channel>
</rss>