Topics
Recent articles

DevOps & Cloud

Deferring Publication After a Budget-Safe Draft Revision

Learn how to preserve a serverless publishing workflow draft when request limits prevent same-run publication by deferring publication.

Table of Contents4 sections
Hand writing in notebook on a desk with laptop, showcasing productivity and organization skills.
Hand writing in notebook on a desk with laptop, showcasing productivity and organization skills.

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.

Quick solution:

if (!hasPublicationBudget) {
  await commitDraftOnly(revisionData);
  return { promotionDeferred: true, readyPath: revisionData.path };
}

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.

Understanding the Request Budget Conflict

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 GitHub REST API Git trees documentation. When a workflow handles candidate commits, promotion preflights, and final vault writes, it can exhaust its budget before publishing.

For more details on platform limits, consult the Cloudflare Workflows limits documentation. 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 Managing Concurrent Git Commits During Automated Publishing.

Implementing a Deferred Publication Fallback

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.

Verification and Execution Checklist

Continue Exploring

You Might Also Like

View all articles
Secure Public Receipt Link with Access Token
5 min read

Secure Public Receipt Link with Access Token

Learn how to build a privacy-safe public receipt link using high-entropy bearer tokens, SHA-256 hashing at rest, constant-time verification, no-store caching, and an explicit allowlisted response DTO.