Lambda durable functions with Pydantic AI: Sume submit as a step
AWS says each model and tool call becomes a durable step that is not repeated after an interruption. Here is how to shape a Sume submit as that step.

Make the Sume submit its own tool call so it is its own durable step, and still send an Idempotency-Key. AWS says completed steps are not repeated after an interruption, but a step that was in flight when the interruption hit is not a completed step.
The AWS facts are from its September 10 announcement; Sume facts from Communication modes, read 2026-10-01.
What did AWS announce?
The announcement says Lambda durable functions now work with Pydantic AI, with each model call and each tool call running as a durable execution step. After an interruption, completed steps are not repeated. AWS gives the benefit as avoiding repeat cost and side effects such as billing a customer twice.
Why is a Sume submit a good step boundary?
A Sume submit is paid and returns quickly with a job id, because async is the default mode and answers 202 with the job envelope. Making it one tool keeps the paid action small: either the step completed and its result is reused, or it did not and runs again.
The gap is the second case. If the call reached Sume and the interruption came before the step was recorded, running it again sends a second request. With the same Idempotency-Key and payload, Sume returns the original job instead of billing twice.
| Moment of interruption | Durable step state | What protects the spend |
|---|---|---|
| After the step completed | Completed, not repeated (AWS) | The recorded result |
| During the submit call | Not completed, runs again | Sume Idempotency-Key on an exact retry |
| While waiting for the render | Submit step already complete | Stored job id; poll GET /v1/jobs/{id}/status |
What does the tool look like?
A standard-library function keeps it dependency free. The caller supplies a key built from your own request id, so every run of the step sends the same one. The returned envelope carries request_id, the job id to store.
I did not verify the durable-function SDK's decorator names, so wrap this function using the AWS documentation for your runtime.
import json
import os
import urllib.request
def submit_video(prompt: str, key: str) -> dict:
req = urllib.request.Request(
"https://api.sume.com/v1/video-1.0/generate",
data=json.dumps({"prompt": prompt, "mode": "async"}).encode(),
headers={
"x-api-key": os.environ["SUME_API_KEY"],
"content-type": "application/json",
"idempotency-key": key,
"user-agent": "sume-example/1.0",
},
method="POST",
)
with urllib.request.urlopen(req, timeout=30) as res:
return json.load(res)How should the wait be handled?
Do not hold one invocation open for the render. Poll as a separate step and honor next_poll_after_seconds, or take a signed webhook. A client timeout does not cancel the job and it still bills. For the invocation ceiling see Lambda's 90-minute limit.
Sources
Related posts
More in Developers
- LangChain invalid tool calls: what Sume returns on a bad call
After LangChain 1.4.3 repairs an invalid tool call, Sume may still return an isError result, such as tool_not_found with a hint. Keep the same idempotency_key.
- LLaDA-Image is open weights: Sume's Image API is a hosted catalog
LLaDA-Image (6B, Apache 2.0, released 2026-09-04) is a download, not an API id. Sume does not list it; use a catalog model with a text-in-image prompt.
- LMNT has shut down: what to know moving to Sume TTS
LMNT's site says it has shut down. If you move to Sume TTS 1.0, voice ids do not carry over, language must be set for non-English text, and text caps at 20000.
- LTX-2 license: models trained on its Outputs are derivatives
The LTX-2 Community License lists models trained on Outputs as Derivatives that must ship under the same license. What the text says and what it leaves open.
Written by Sume