Class: StrandsPlugin
strands.StrandsPlugin
Temporal plugin that runs Strands Agents inside Temporal workflows. Model, MCP tool, and (via workflow.activityAsTool) custom-tool invocations are routed through Temporal Activities for durable execution, retries, and timeouts.
Register on the worker (and on the client when using activityAsTool with
interrupts, so the client-side data converter picks up the failure
converter):
const client = await Client.connect({ plugins: [new StrandsPlugin({...})] });
const worker = new Worker({ ..., plugins: [new StrandsPlugin({...})] });
Hierarchy
-
↳
StrandsPlugin
Constructors
constructor
• new StrandsPlugin(options?): StrandsPlugin
Parameters
| Name | Type |
|---|---|
options? | StrandsPluginOptions |
Returns
Overrides
Properties
name
• Readonly name: string
The name of the plugin
Inherited from
Methods
configureBundler
▸ configureBundler(options): BundleOptions
Extend the bundler config so workflow code can bundle @strands-agents/sdk:
-
Ignore worker-only / non-workflow-safe modules that the SDK index transitively pulls in but that are unreachable from workflow code. This covers:
fs(statically imported byvended-pluginsandvended-tools).- Every
@strands-agents/sdkmodel provider's HTTP SDK (@aws-sdk/client-bedrock-runtime,@anthropic-ai/sdk,openai,@google/genai,ai). The workers constructs models worker-side; workflow code only goes through TemporalModel. @temporalio/activityand@temporalio/client, which the worker-only halves of TemporalMCPClient, autoHeartbeat, and@temporalio/workflow-streams/clientimport.path/crypto, pulled in transitively by the same worker-only code.
-
Replace the dynamic-imported MCP transport helpers (
@modelcontextprotocol/sdk/client/{stdio,sse,streamableHttp}.jsand theirnode:*dependencies, pluseventsource-parser/streamwhichstreamableHttp.jsreaches) with an empty module. They live inmcp-config.js's server-only code paths. -
Inline async chunks so the bundle stays a single file — webpack's default JSONP chunk loader references
self/document, neither of which exists in the workflow VM.
Parameters
| Name | Type |
|---|---|
options | BundleOptions |
Returns
Overrides
configureClient
▸ configureClient(options): ClientOptions
Configures client options by merging plugin parameters with existing options.
Parameters
| Name | Type | Description |
|---|---|---|
options | ClientOptions | The existing client options |
Returns
Modified client options with plugin configuration applied
Inherited from
configureConnection
▸ configureConnection(options): ConnectionOptions
Configures connection options by merging plugin parameters with existing options. Special handling for function-based API keys.
Parameters
| Name | Type | Description |
|---|---|---|
options | ConnectionOptions | The existing connection options |
Returns
Modified connection options with plugin configuration applied
Inherited from
SimplePlugin.configureConnection
configureNativeConnection
▸ configureNativeConnection(options): NativeConnectionOptions
Configures native connection options by merging plugin parameters with existing options.
Parameters
| Name | Type | Description |
|---|---|---|
options | NativeConnectionOptions | The existing native connection options |
Returns
Modified native connection options with plugin configuration applied
Inherited from
SimplePlugin.configureNativeConnection
configureReplayWorker
▸ configureReplayWorker(options): ReplayWorkerOptions
Configures replay worker options by merging plugin parameters with existing options.
Parameters
| Name | Type | Description |
|---|---|---|
options | ReplayWorkerOptions | The existing replay worker options |
Returns
Modified replay worker options with plugin configuration applied
Inherited from
SimplePlugin.configureReplayWorker
configureWorker
▸ configureWorker(options): WorkerOptions
Configures worker options by merging plugin parameters with existing options. Activities and nexus services are appended, while other options are replaced.
Parameters
| Name | Type | Description |
|---|---|---|
options | WorkerOptions | The existing worker options |
Returns
Modified worker options with plugin configuration applied
Inherited from
runWorker
▸ runWorker(worker, next): Promise<void>
Runs the worker, optionally wrapping execution in a custom context.
Parameters
| Name | Type | Description |
|---|---|---|
worker | Worker | The worker instance to run |
next | (w: Worker) => Promise<void> | Function to continue worker execution |
Returns
Promise<void>
Promise that resolves when worker execution completes