class documentation

Temporal Worker plugin for the Strands Agents SDK.

When models is supplied, registers a single pair of model invocation activities; each call carries the chosen model_name in its input and the worker resolves it against the factories. Factories are called lazily on first use, then cached for the worker's lifetime. Use the same name in TemporalAgent(model=...) inside the workflow.

When mcp_clients is supplied, registers per-server {server}-call-tool and {server}-list-tools activities for each entry. Workflow-side TemporalMCPClient(server="...") discovers tools by running {server}-list-tools; whether it lists once per workflow or once per agent turn is controlled by its cache_tools option.

mcp_connection_idle_timeout controls how long a worker-process MCP connection is kept open between call-tool activities before it is disconnected; the timer resets on every reuse. Defaults to 5 minutes.

When sandboxes is supplied, registers one stable set of activities that dispatches each operation by sandbox name. Each factory receives the requesting Workflow run's context and may return a sandbox directly or awaitably. The factory is called for every Activity so it can find or recover the backing environment. Use the same name in workflow-side TemporalSandbox(name) instances.

resolvable_worker_env_vars controls which worker environment variables sandbox command env references may resolve immediately before execution.

Method __init__ Build the plugin from optional model, MCP, and sandbox factories.

Inherited from SimplePlugin:

Method configure_client See base class.
Method configure_replayer See base class.
Method configure_worker See base class.
Async Method connect_service_client See base class.
Method name See base class.
Async Method run_replayer See base class.
Async Method run_worker See base class.
Instance Variable activities Undocumented
Instance Variable data_converter Undocumented
Instance Variable interceptors Undocumented
Instance Variable nexus_service_handlers Undocumented
Instance Variable run_context Undocumented
Instance Variable workflow_failure_exception_types Undocumented
Instance Variable workflow_runner Undocumented
Instance Variable workflows Undocumented
Instance Variable _name Undocumented
def __init__(self, *, models: dict[str, Callable[[], Model]] | None = None, mcp_clients: dict[str, Callable[[], MCPClient]] | None = None, sandboxes: dict[str, SandboxFactory] | None = None, mcp_connection_idle_timeout: timedelta | None = None, resolvable_worker_env_vars: Collection[str] | AllowAllWorkerEnvVars = ()): (source) ΒΆ

Build the plugin from optional model, MCP, and sandbox factories.

If models is omitted, registers a single BedrockModel factory under the name "bedrock" with Botocore retries disabled.

A sandbox factory may return an async context manager when its adapter needs cleanup after the Activity finishes.