These samples demonstrate the Temporal Strands plugin, which runs Strands Agents inside Temporal Workflows. Model invocations, tool calls, and MCP tool calls all execute as Temporal Activities, so you get durable execution, Temporal-managed retries, and timeouts.
-
Install dependencies:
uv sync --group strands-agents
This installs the standalone
temporalio-strands-agentspackage, which requires Temporal 1.34.0 or later. -
Configure AWS credentials. The samples use the plugin's default
BedrockModel(), which picks up the standard AWS SDK credential chain. Make sure the credentials grant access to a Bedrock model in your selected region (e.g.,us-west-2).export AWS_REGION=us-west-2 # plus AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY or an SSO profile
You can pick a specific model by passing it to
BedrockModel(model_id="...")in each sample's worker. -
Start a local dev server with the Temporal CLI:
temporal server start-dev
Each sample has two scripts. Start the Worker first, then the Workflow starter in a separate terminal:
# Terminal 1: start the Worker
uv run strands_plugin/<sample>/run_worker.py
# Terminal 2: start the Workflow
uv run strands_plugin/<sample>/run_workflow.pyFor example, to run the tools sample:
# Terminal 1
uv run strands_plugin/tools/run_worker.py
# Terminal 2
uv run strands_plugin/tools/run_workflow.py- Durable model invocation — every model call runs in an
invoke_modelactivity with configurable timeouts and retries. - Three ways to define tools — pure Strands
@tool, custom Temporal activities, and ecosystemstrands_toolswrapped as activities. - Human-in-the-loop — both hook-based (
BeforeToolCallEvent.interrupt()) and tool-body (raise InterruptException) styles. - Hook system — deterministic in-workflow callbacks plus I/O callbacks dispatched via
activity_as_hook. - MCP integration — connect to MCP servers at worker startup; tool calls dispatched through per-server activities.
- Structured output — Pydantic-typed agent results via the plugin's
pydantic_data_converter. - Streaming — forward model chunks live to external subscribers.
- Long-lived chats — hand off
agent.messagesviacontinue-as-newto stay under Temporal's history limit.
