Node execution happens on queues. Queues retry. A handler will therefore be run
again for work it has already done — after a timeout, a worker restart, or a
transient provider failure — and it must be written so that the second run is
harmless.
Every handler must be safe to retry. This is not a quality goal; it is part of
the contract.
State changes are usually fine
Writing flow.answer twice with the same value costs nothing. Pure state
transitions are naturally idempotent, and most handlers need no further thought.
External side effects are not
The moment a handler sends a message, calls an API, charges something, or creates
a record in another system, a retry becomes visible to someone. Those effects need
an idempotency marker, or an equivalent guard, so that the second attempt
recognises the first.The usual shapes:A deterministic key. Derive an identifier from facts that do not change
between attempts — the session, the node, and the thing being acted on — and let
the receiving system reject the duplicate. The webhook gateway does exactly this
with keys such as tg:{channel}:{body.update_id}.A recorded marker. Write “this was done” as part of the same transaction as
the effect, and check it on entry. This works when the effect is local.A provider-supplied idempotency key. Most payment and messaging APIs accept
one. Use it rather than inventing a guard around a call that already supports it.
What the call node does for you
The built-in call node sends an Idempotency-Key header (the same value when the queue
runs the step again, a new one on each pass of a loop) and an X-FaPost-Attempt-Number
header. It also remembers a call that succeeded for about a week, and when the same step
runs again it reuses that result instead of sending the request a second time. A call
that failed is sent again with the same key and the next attempt number, whether the
queue runs the step again or the node’s own retry sends it after a wait.
What not to rely on
Do not rely on “this rarely happens”. Retries are routine, not exceptional.Do not rely on checking whether the effect appears to have happened by reading
back from the external system — between the read and the write, the first attempt
may still be in flight.Do not use a timestamp or a random value in the key. A retry generates a new one,
which is precisely the case the key exists to catch.
Waiting is not failing
A handler that needs to pause returns NodeExecutionResult::waiting() or
::delayed(). That is a normal outcome, not an error. Reach for it instead of
throwing when the flow simply is not ready to continue.waiting() and plain delayed() behave the same: the contact’s next message
runs the handler again, so mark the work it already did (see above) so that
run does not repeat it.delayed(resumeAt: $when) runs the handler again too — at $when, with
NodeExecutionContext::$resumedAfterDelay set — but retries are still in
play: the queued wake-up is safe to fire more than once for the same
resumeAt (a duplicated or re-scheduled job), and a message arriving right
around $when can also land the node back here through the ordinary routing
path. Guard any external side effect the same way you would for a first-run
handler — the resumedAfterDelay run is not exempt from this page’s rules.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"FaPost","description":"Conversational assistants and flow automation platform.","colors":{"primary":"#5a6e58","light":"#94a187","dark":"#3f4f3d"},"favicon":"https://mintcdn.com/fapost/dkK02WohiwWLokiz/favicon.svg?fit=max\u0026auto=format\u0026n=dkK02WohiwWLokiz\u0026q=85\u0026s=f3739e1cf80934093fb16564881363f9","background":{"color":{"light":"#f5f4f1","dark":"#131211"}},"navbar":{"links":[{"href":"https://github.com/fapost-lab/core","type":"github"}]},"footer":{"socials":{"github":"https://github.com/fapost-lab/core","website":"https://fapost.in"}},"fonts":{"family":"DM Sans"},"styling":{"codeblocks":{"theme":"one-dark-pro"},"latex":false},"banner":{"content":"FaPost is pre-1.0 and this documentation is still being written. Sections say where they are incomplete.","dismissible":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"fapost","hasAudioNarration":false,"actualSubdomain":"fapost","customDomains":["docs.fapost.in"],"gitSource":{"type":"github","owner":"fapost-lab","repo":"core","deployBranch":"main","contentDirectory":"docs/site","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b0dec005fc55b6fe10383d1","clientVersion":"0.0.4352","searchFilterCounts":[{"language":"default","tag":"Developers","count":36},{"language":"default","tag":"User guide","count":36},{"language":"default","tag":"Self-hosting","count":15},{"language":"default","tag":"Admin panel","count":11},{"language":"default","tag":"Flows","count":10},{"language":"default","tag":"Reference","count":8},{"language":"default","tag":"Operate","count":7},{"language":"default","tag":"Core internals","count":6},{"language":"default","tag":"Development environment","count":5},{"language":"default","tag":"Contributing to Core","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"#content.mdx-content h2{font-size:1.75rem;line-height:1.25;letter-spacing:-0.02em;margin-top:4rem;padding-top:2rem;border-top:1px solid rgb(23 23 23 / 12%)}.dark #content.mdx-content h2{border-top-color:rgb(255 255 255 / 12%)}#content.mdx-content h2:first-child{margin-top:1rem;padding-top:0;border-top:0}#content.mdx-content h3{font-size:1.3125rem;line-height:1.35;letter-spacing:-0.01em;margin-top:2.75rem}#content.mdx-content h4{font-size:1.0625rem;line-height:1.4;margin-top:2rem;color:rgb(82 82 82)}.dark #content.mdx-content h4{color:rgb(163 163 163)}@media (max-width: 639px){#content.mdx-content h2{font-size:1.5rem;margin-top:3rem;padding-top:1.5rem}#content.mdx-content h3{font-size:1.1875rem;margin-top:2.25rem}}"}]}
{"page":{"pagePath":"extending/flow-nodes/idempotency","slug":"/extending/flow-nodes/idempotency","pageMetadata":{"title":"Idempotency and retries","description":"Making a handler safe to run more than once.","href":"/extending/flow-nodes/idempotency"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Making a handler safe to run more than once.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,strong:`strong`,..._provideComponents(),...props.components},{Heading,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Node execution happens on queues. Queues retry. A handler will therefore be run\nagain for work it has already done — after a timeout, a worker restart, or a\ntransient provider failure — and it must be written so that the second run is\nharmless.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Every handler must be safe to retry. This is not a quality goal; it is part of\nthe contract.`})}),`\n`,_jsx(Heading,{level:`2`,id:`state-changes-are-usually-fine`,children:`State changes are usually fine`}),`\n`,_jsxs(_components.p,{children:[`Writing `,_jsx(_components.code,{children:`flow.answer`}),` twice with the same value costs nothing. Pure state\ntransitions are naturally idempotent, and most handlers need no further thought.`]}),`\n`,_jsx(Heading,{level:`2`,id:`external-side-effects-are-not`,children:`External side effects are not`}),`\n`,_jsx(_components.p,{children:`The moment a handler sends a message, calls an API, charges something, or creates\na record in another system, a retry becomes visible to someone. Those effects need\nan idempotency marker, or an equivalent guard, so that the second attempt\nrecognises the first.`}),`\n`,_jsx(_components.p,{children:`The usual shapes:`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`A deterministic key.`}),` Derive an identifier from facts that do not change\nbetween attempts — the session, the node, and the thing being acted on — and let\nthe receiving system reject the duplicate. The webhook gateway does exactly this\nwith keys such as `,_jsx(_components.code,{children:`tg:{channel}:{body.update_id}`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`A recorded marker.`}),` Write “this was done” as part of the same transaction as\nthe effect, and check it on entry. This works when the effect is local.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`A provider-supplied idempotency key.`}),` Most payment and messaging APIs accept\none. Use it rather than inventing a guard around a call that already supports it.`]}),`\n`,_jsxs(Heading,{level:`2`,id:`what-the-call-node-does-for-you`,children:[`What the `,_jsx(_components.code,{children:`call`}),` node does for you`]}),`\n`,_jsxs(_components.p,{children:[`The built-in `,_jsx(_components.code,{children:`call`}),` node sends an `,_jsx(_components.code,{children:`Idempotency-Key`}),` header (the same value when the queue\nruns the step again, a new one on each pass of a loop) and an `,_jsx(_components.code,{children:`X-FaPost-Attempt-Number`}),`\nheader. It also remembers a call that succeeded for about a week, and when the same step\nruns again it reuses that result instead of sending the request a second time. A call\nthat failed is sent again with the same key and the next attempt number, whether the\nqueue runs the step again or the node’s own `,_jsx(_components.code,{children:`retry`}),` sends it after a wait.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-not-to-rely-on`,children:`What not to rely on`}),`\n`,_jsx(_components.p,{children:`Do not rely on “this rarely happens”. Retries are routine, not exceptional.`}),`\n`,_jsx(_components.p,{children:`Do not rely on checking whether the effect appears to have happened by reading\nback from the external system — between the read and the write, the first attempt\nmay still be in flight.`}),`\n`,_jsx(_components.p,{children:`Do not use a timestamp or a random value in the key. A retry generates a new one,\nwhich is precisely the case the key exists to catch.`}),`\n`,_jsx(Heading,{level:`2`,id:`waiting-is-not-failing`,children:`Waiting is not failing`}),`\n`,_jsxs(_components.p,{children:[`A handler that needs to pause returns `,_jsx(_components.code,{children:`NodeExecutionResult::waiting()`}),` or\n`,_jsx(_components.code,{children:`::delayed()`}),`. That is a normal outcome, not an error. Reach for it instead of\nthrowing when the flow simply is not ready to continue.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`waiting()`}),` and plain `,_jsx(_components.code,{children:`delayed()`}),` behave the same: the contact’s next message\nruns the handler again, so mark the work it already did (see above) so that\nrun does not repeat it.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`delayed(resumeAt: $when)`}),` runs the handler again too — at `,_jsx(_components.code,{children:`$when`}),`, with\n`,_jsx(_components.code,{children:`NodeExecutionContext::$resumedAfterDelay`}),` set — but retries are still in\nplay: the queued wake-up is safe to fire more than once for the same\n`,_jsx(_components.code,{children:`resumeAt`}),` (a duplicated or re-scheduled job), and a message arriving right\naround `,_jsx(_components.code,{children:`$when`}),` can also land the node back here through the ordinary routing\npath. Guard any external side effect the same way you would for a first-run\nhandler — the `,_jsx(_components.code,{children:`resumedAfterDelay`}),` run is not exempt from this page’s rules.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":"one-dark-pro"},"config":{},"pageMetadata":{"title":"Idempotency and retries","description":"Making a handler safe to run more than once.","href":"/extending/flow-nodes/idempotency"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"State changes are usually fine","slug":"state-changes-are-usually-fine","depth":2,"children":[]},{"title":"External side effects are not","slug":"external-side-effects-are-not","depth":2,"children":[]},{"title":"What the call node does for you","slug":"what-the-call-node-does-for-you","depth":2,"children":[]},{"title":"What not to rely on","slug":"what-not-to-rely-on","depth":2,"children":[]},{"title":"Waiting is not failing","slug":"waiting-is-not-failing","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"fapost","siteName":"FaPost","title":"Idempotency and retries - FaPost","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-18T23:58:47.401Z","originalFileLocation":"extending/flow-nodes/idempotency.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Making a handler safe to run more than once.\">\u003cmeta data-mint-head name=\"application-name\" content=\"FaPost\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Idempotency and retries - FaPost\">\u003cmeta data-mint-head property=\"og:description\" content=\"Making a handler safe to run more than once.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"FaPost\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.fapost.in/extending/flow-nodes/idempotency\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://fapost.mintlify.site/_mintlify/api/og/v2?division=Flow+nodes\u0026amp;title=Idempotency+and+retries\u0026amp;description=Making+a+handler+safe+to+run+more+than+once.\u0026amp;theme=baf5a1f6c1a967e68ab29869\u0026amp;signature=561779205bb84fb4423cc10f19cd2462349ea80b587019fbfe2fe3e852c0e692\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Idempotency and retries - FaPost\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Making a handler safe to run more than once.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://fapost.mintlify.site/_mintlify/api/og/v2?division=Flow+nodes\u0026amp;title=Idempotency+and+retries\u0026amp;description=Making+a+handler+safe+to+run+more+than+once.\u0026amp;theme=baf5a1f6c1a967e68ab29869\u0026amp;signature=561779205bb84fb4423cc10f19cd2462349ea80b587019fbfe2fe3e852c0e692\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/fapost/2DoYb1P3wGVpeaWw/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"FaPost\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5a6e58\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.fapost.in/extending/flow-nodes/idempotency\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/extending/flow-nodes/idempotency.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.fapost.in/#organization\",\"name\":\"FaPost\",\"url\":\"https://docs.fapost.in\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.fapost.in#website\",\"name\":\"FaPost\",\"url\":\"https://docs.fapost.in\",\"publisher\":{\"@id\":\"https://docs.fapost.in/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.fapost.in/extending/flow-nodes/idempotency#webpage\",\"url\":\"https://docs.fapost.in/extending/flow-nodes/idempotency\",\"name\":\"Idempotency and retries\",\"description\":\"Making a handler safe to run more than once.\",\"dateModified\":\"2026-11-18T23:58:47.401Z\",\"isPartOf\":{\"@id\":\"https://docs.fapost.in#website\"},\"breadcrumb\":{\"@id\":\"https://docs.fapost.in/extending/flow-nodes/idempotency#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.fapost.in/extending/flow-nodes/idempotency#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Flow nodes\",\"item\":\"https://docs.fapost.in/extending/flow-nodes/handler-contract\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Idempotency and retries\",\"item\":\"https://docs.fapost.in/extending/flow-nodes/idempotency\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.fapost.in/extending/flow-nodes/idempotency#article\",\"headline\":\"Idempotency and retries\",\"name\":\"Idempotency and retries\",\"description\":\"Making a handler safe to run more than once.\",\"url\":\"https://docs.fapost.in/extending/flow-nodes/idempotency\",\"mainEntityOfPage\":{\"@id\":\"https://docs.fapost.in/extending/flow-nodes/idempotency#webpage\"},\"dateModified\":\"2026-11-18T23:58:47.401Z\",\"publisher\":{\"@id\":\"https://docs.fapost.in/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.fapost.in#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"FaPost\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"FaPost\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/extending/flow-nodes/idempotency.md","siteName":"FaPost","nav":{"global":null,"tabs":[{"tab":"User guide","pages":[{"title":"User guide","href":""}]},{"tab":"Self-hosting","pages":[{"title":"Self-hosting","href":"/self-hosting/overview"}]},{"tab":"Developers","groups":[{"group":"Overview","pages":[{"title":"For developers","href":"/contributing/overview"},{"title":"Technology stack","href":"/contributing/stack"}]},{"group":"Development environment","pages":[{"title":"Local setup","href":"/contributing/local-setup"},{"title":"Receiving webhooks locally","href":"/contributing/local-webhooks"},{"title":"Repository layout","href":"/contributing/repo-layout"},{"title":"Coding conventions","href":"/contributing/conventions"},{"title":"Coding agents and Jig","href":"/contributing/coding-agents"}]},{"group":"Extension model","pages":[{"title":"Extension model","href":"/extending/extension-model"},{"title":"Choosing an extension type","href":"/extending/choosing-an-extension-type"}]},{"group":"Building extensions","pages":[{"title":"Development setup","href":"/extending/development-setup"},{"title":"Building a Solution","href":"/extending/solutions"},{"title":"Starting a Solution","href":"/extending/solution-scaffold"},{"title":"Connectors","href":"/extending/connectors"},{"title":"Building a Plugin","href":"/extending/plugins"}]},{"group":"Flow nodes","pages":[{"title":"Handler contract","href":"/extending/flow-nodes/handler-contract"},{"title":"Versioning and compatibility","href":"/extending/flow-nodes/versioning"},{"title":"State namespaces","description":"The system, flow, rag, module, contact, and call key spaces.","href":"/extending/flow-nodes/state-namespaces"},{"title":"Idempotency and retries","href":"/extending/flow-nodes/idempotency"}]},{"group":"Extension surfaces","pages":[{"title":"Builder UI extensions","description":"Schema-driven configuration and when an override is justified.","href":"/extending/builder-ui"},{"title":"Console UI","href":"/extending/console-ui"},{"title":"Channel contracts","href":"/extending/channel-drivers"},{"title":"Data accessors","href":"/extending/data-accessors"},{"title":"Multilingual extensions","href":"/extending/multilingual"}]},{"group":"Shipping an extension","pages":[{"title":"Testing your extension","href":"/extending/testing"},{"title":"Stability policy","href":"/extending/stability-policy"}]},{"group":"Core internals","pages":[{"title":"Runtime architecture","href":"/contributing/runtime"},{"title":"Tenant-aware execution","href":"/contributing/tenant-aware-execution"},{"title":"Migration isolation","href":"/contributing/migration-isolation"},{"title":"Long-lived worker safety","href":"/contributing/worker-safety"},{"title":"ID strategy","href":"/contributing/id-strategy"},{"title":"Dependency direction","href":"/contributing/dependency-direction"}]},{"group":"Contributing to Core","pages":[{"title":"Testing and architecture checks","href":"/contributing/testing"},{"title":"Commit messages","href":"/contributing/commits"},{"title":"Pull requests","href":"/contributing/pull-requests"},{"title":"Releases and versioning","href":"/contributing/releases"},{"title":"Licence, CLA and trademark","href":"/contributing/legal"}]}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/reference/foundation-contracts"}]}]},"basePath":"","title":"Idempotency and retries - FaPost","deploymentId":"dpl_5nNsUVHqbVdUHouroPPzwztSbjmH","buildId":"dpl_5nNsUVHqbVdUHouroPPzwztSbjmH","dynamics":[],"chunks":[]}