From 2ea4d190834d933a0113a1220492bd2811de61e3 Mon Sep 17 00:00:00 2001 From: Frank Chen Date: Thu, 2 Jul 2026 11:42:17 -0700 Subject: [PATCH] docs: clarify invoke supports standard Lambda functions --- README.md | 4 ++-- docs/core/invoke.md | 10 ++++++++-- .../durable/examples/invoke/SimpleInvokeExample.java | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 94ffeaa5a..879c9680a 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Your durable function extends `DurableHandler` and implements `handleReque - `ctx.wait()` – Suspend execution without compute charges - `ctx.createCallback()` – Wait for external events (approvals, webhooks) - `ctx.waitForCallback()` – Simplify callback handling by combining callback creation and submission in one operation -- `ctx.invoke()` – Invoke another Lambda function and wait for the result +- `ctx.invoke()` – Invoke another Lambda function, durable or standard, and wait for the result - `ctx.runInChildContext()` – Run an isolated child context with its own checkpoint log - `ctx.map()` – Apply a function to each item in a collection concurrently - `ctx.parallel()` - Run multiple operations concurrently with optional concurrency control @@ -96,7 +96,7 @@ See [Deploy Lambda durable functions with Infrastructure as Code](https://docs.a - [Steps](docs/core/steps.md) – Execute code with automatic checkpointing and retry support - [Wait](docs/core/wait.md) - Pause execution without blocking Lambda resources - [Callbacks](docs/core/callbacks.md) - Wait for external systems to respond -- [Invoke](docs/core/invoke.md) - Call other durable functions +- [Invoke](docs/core/invoke.md) - Call durable functions or standard Lambda functions - [Child Contexts](docs/core/child-contexts.md) - Organize complex workflows into isolated units - [Map](docs/core/map.md) - Apply a function across a collection concurrently - [Parallel](docs/core/parallel.md) - Run multiple operations concurrently with optional concurrency control diff --git a/docs/core/invoke.md b/docs/core/invoke.md index 9e474cfad..e79c99cf0 100644 --- a/docs/core/invoke.md +++ b/docs/core/invoke.md @@ -1,4 +1,10 @@ -## invoke() - Invoke another Lambda function +## invoke() - Invoke Other Lambda Functions Durably + +The invoke operation calls another Lambda function and waits for its result. It supports both durable functions and standard on-demand Lambda functions. + +When you call `ctx.invoke()` or `ctx.invokeAsync()`, the SDK checkpoints the start of the operation and the durable functions backend invokes the target Lambda function. On replay, the SDK returns the checkpointed result without invoking the target again. + +`functionName` can be a Lambda function name or ARN. Durable function targets require an alias or version qualifier; standard on-demand Lambda functions do not require a qualifier. ```java @@ -14,4 +20,4 @@ var result = ctx.invoke("invoke-function", .build() ); -``` \ No newline at end of file +``` diff --git a/examples/src/main/java/software/amazon/lambda/durable/examples/invoke/SimpleInvokeExample.java b/examples/src/main/java/software/amazon/lambda/durable/examples/invoke/SimpleInvokeExample.java index 3c4dd351e..b675c7966 100644 --- a/examples/src/main/java/software/amazon/lambda/durable/examples/invoke/SimpleInvokeExample.java +++ b/examples/src/main/java/software/amazon/lambda/durable/examples/invoke/SimpleInvokeExample.java @@ -10,13 +10,13 @@ /** * Simple example demonstrating basic invoke execution with the Durable Execution SDK. * - *

This handler invokes another durable lambda function simple-step-example + *

This handler invokes another Lambda function, such as simple-step-example. */ public class SimpleInvokeExample extends DurableHandler { @Override public String handleRequest(GreetingRequest input, DurableContext context) { - // invoke `simple-step-example` function + // Invoke the `simple-step-example` function. var future = context.invokeAsync( "call-greeting1", "simple-step-example" + input.getName() + ":$LATEST",