Skip to content

feat(lambda): add an AWS Lambda sample - #76

Open
xepozz wants to merge 3 commits into
masterfrom
feature/lambda-sample
Open

xepozz wants to merge 3 commits into
masterfrom
feature/lambda-sample

Conversation

@xepozz

@xepozz xepozz commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

What was changed

A Temporal worker that runs inside AWS Lambda invocations. The Lambda Runtime API is served by the RoadRunner Temporal plugin (temporal.lambda config), so the PHP side is an ordinary WorkerFactory::create() worker. The sample workflow sleeps past a single invocation to show that it resumes on a later one.

Needs roadrunner-temporal v6.2.0, which the RoadRunner v3.2.0 release predates, so velox.toml pins that tag.

Why?

PHP had no Serverless Worker story; Go, Python, TypeScript, Java and .NET all have one.

Checklist

  1. Closes

  2. How was this tested:

Locally under the AWS Lambda Runtime Interface Emulator, unversioned and with VersioningBehavior::Pinned. The workflow completes across invocations, and an activity longer than the polling window either finishes in the shutdown drain or resumes from heartbeat details later.

  1. Any docs updates needed?

app/src/Lambda/README.md covers local run, configuration, deployment and versioning.

The worker runs as a Lambda custom runtime through vendor/bin/lambda. The
sample workflow sleeps past a single invocation to show that it resumes on
a later one. Pins temporal/sdk to the branch that ships bin/lambda.
Lambda mode moved into roadrunner-temporal v6.2.0, so the separate aws-lambda
plugin and its local replace are gone and the config lives under
temporal.lambda. Raises temporal/sdk to v2.20 for the RoadRunner 3.x version
check.
@xepozz
xepozz force-pushed the feature/lambda-sample branch from 37d5821 to 3b75adf Compare December 2, 2026 06:29
@xepozz xepozz closed this Dec 2, 2026
@xepozz xepozz reopened this Dec 2, 2026
@xepozz
xepozz marked this pull request as ready for review December 2, 2026 15:14
@xepozz
xepozz requested review from a team, roxblnfk and wolfy-j as code owners December 2, 2026 15:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T15:17:04.459954Z 3b75adf Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b75adf97b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/Lambda/README.md
**3. Start the workflow.** In another terminal:

```bash
docker compose exec app php app.php lambda

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Start the app service before executing the client command

On a fresh checkout, the local walkthrough never starts the app service: step 1 starts only temporal and its dependencies, while step 2 starts the separate Lambda container. In the inspected docker-compose.yml, app depends on temporal, not the reverse. Consequently, this command cannot start the workflow because app is not running. Docker documents compose exec as executing a command “in a running container” (reference). Add an explicit app startup step or document the prerequisite.

Useful? React with 👍 / 👎.

$workflow = $this->workflowClient->newWorkflowStub(
GreetingWorkflowInterface::class,
WorkflowOptions::new()
->withTaskQueue(self::TASK_QUEUE)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the configured task queue in the client command

When the worker is configured with a nondefault TEMPORAL_TASK_QUEUE, this command still submits workflows to the hard-coded php-lambda queue. lambda/Makefile explicitly exposes that variable and passes it to the container, and lambda/worker.php uses it to select the worker's queue, so the worker never receives the submitted workflow and the client eventually encounters the five-minute execution timeout. Allow the client to select the same configured queue, retaining php-lambda as its default.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant