An invocation ends once its code execution finishes.
Streaming Status Updates
For real-time status monitoring, usefollow to stream invocation events. This provides immediate updates as your invocation progresses and is more efficient than polling.
Example
Here’s an example showing how to handle streaming status updates:Failure details
A failed invocation has two distinct fields:status_reason: A nonempty, customer-safe failure summary. It’s present whenstatusisfailedand omitted for other statuses. Recognized messages, such as timeout or startup failure messages, receive specific summaries. Unrecognized failures receive"Invocation failed. See output for details."; failures with no recorded reason receive"Invocation failed; no failure reason was recorded.".output: The original action result or detailed failure output. It’s optional and often JSON-encoded, but failures can contain plain text. Don’t assume that every failure output can be parsed as JSON.
invocation_state event includes status_reason. Historical invocations also receive a summary when you retrieve or stream them; no rerun is needed. During rollout, if status_reason is absent, inspect output for the recorded error.
For example, a timeout returns these fields alongside the invocation’s ID and other metadata:
status_reason to display the failure and inspect output separately for diagnostics. Summaries match the recorded error text, which can come from either the platform or your action code. A matching message doesn’t establish where the failure originated. Reason text can change; don’t use it as a stable identifier for retry decisions.
Polling Status Updates
Alternatively, you can poll the status endpoint usingretrieve to check the invocation status periodically.