class StrandsPlugin(SimplePlugin): (source)
Constructor: StrandsPlugin(models, mcp_clients, sandboxes, mcp_connection_idle_timeout, ...)
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 |
See base class. |
| Method | configure |
See base class. |
| Method | configure |
See base class. |
| Async Method | connect |
See base class. |
| Method | name |
See base class. |
| Async Method | run |
See base class. |
| Async Method | run |
See base class. |
| Instance Variable | activities |
Undocumented |
| Instance Variable | data |
Undocumented |
| Instance Variable | interceptors |
Undocumented |
| Instance Variable | nexus |
Undocumented |
| Instance Variable | run |
Undocumented |
| Instance Variable | workflow |
Undocumented |
| Instance Variable | workflow |
Undocumented |
| Instance Variable | workflows |
Undocumented |
| Instance Variable | _name |
Undocumented |
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)
ΒΆ
temporalio.plugin.SimplePlugin.__init__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.