Namespace: openaiAgentsWorkflow
Classes
Interfaces
- ActivityAsToolOptions
- ActivityToolDefinition
- AgentAsToolOptions
- JsonObjectSchema
- NexusOperationAsToolOptions
- NexusOperationToolDefinition
- StatefulMcpServerOptions
- StatefulTemporalMCPServer
- StatelessMcpServerOptions
- TemporalOpenAIRunnerOptions
- TemporalRunOptions
- WorkflowSafeMemorySessionOptions
References
DEDICATED_WORKER_FAILURE_TYPE
Re-exports DEDICATED_WORKER_FAILURE_TYPE
Functions
activityAsTool
▸ activityAsTool<TActivity>(definition, options?): FunctionTool
Wraps a Temporal Activity as an OpenAI Agents FunctionTool. When the agent
invokes the tool, it schedules the named Activity via proxyActivities and
returns the stringified result.
Type parameters
| Name | Type |
|---|---|
TActivity | extends (input: any) => Promise<any> |
Parameters
| Name | Type |
|---|---|
definition | ActivityToolDefinition<TActivity> |
options? | ActivityAsToolOptions |
Returns
FunctionTool
agentAsTool
▸ agentAsTool<TAgent>(agent, options): FunctionTool
Nested approval interruptions are not supported: invoke throws
ApplicationFailure of type NestedAgentInterruption. Handle approvals
at the top-level runner instead.
Type parameters
| Name | Type |
|---|---|
TAgent | extends Agent<any, any> |
Parameters
| Name | Type |
|---|---|
agent | TAgent |
options | AgentAsToolOptions<TAgent> |
Returns
FunctionTool
nexusOperationAsTool
▸ nexusOperationAsTool<TService, TOp>(operation, definition, options): FunctionTool
Wraps a Nexus Operation as an OpenAI Agents FunctionTool. When the agent
invokes the tool, it calls the Operation through a Workflow-side Nexus
client (createNexusServiceClient) and returns the stringified result.
This is the Nexus counterpart of activityAsTool: instead of scheduling a Temporal Activity, the tool invocation schedules a Nexus Operation against the configured endpoint and service.
Type parameters
| Name | Type |
|---|---|
TService | extends ServiceDefinition<OperationMap> |
TOp | extends OperationDefinition<any, any> |
Parameters
| Name | Type |
|---|---|
operation | TOp |
definition | NexusOperationToolDefinition<TOp> |
options | NexusOperationAsToolOptions<TService> |
Returns
FunctionTool
statefulMcpServer
▸ statefulMcpServer(name, options?): StatefulTemporalMCPServer
Creates a stateful MCP server handle. Maintains a persistent MCP connection across the Workflow via a dedicated per-run Worker.
If the dedicated Worker fails (startup timeout or missed heartbeat),
operations throw ApplicationFailure with type "DedicatedWorkerFailure".
Parameters
| Name | Type | Description |
|---|---|---|
name | string | Server name; must match the StatefulMCPServerProvider registered on the Worker side. |
options? | StatefulMcpServerOptions | - |
Returns
statelessMcpServer
▸ statelessMcpServer(name, options?): MCPServer
Parameters
| Name | Type |
|---|---|
name | string |
options? | StatelessMcpServerOptions |
Returns
MCPServer
temporalSandboxClient
▸ temporalSandboxClient(name, config?): TemporalSandboxClient
Creates a Workflow-side sandbox client for RunConfig.sandbox. All sandbox
operations are dispatched as Activities to the SandboxClientProvider
registered under the same name on the Worker.
When config is omitted, Activities use a five-minute start-to-close timeout.
A supplied ActivityOptions object is used as-is without merging defaults.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | Provider name; must match the SandboxClientProvider registered on the Worker side. |
config? | ActivityOptions | Activity options for every sandbox operation. |
Returns
TemporalSandboxClient
workerEnvValue
▸ workerEnvValue(name): EnvValueReference
Returns a Manifest environment value that names a Worker environment variable instead of holding a credential. Only the variable name crosses into the Activity arguments that every sandbox operation records in Workflow history; the Worker reads the value from its own environment when the sandbox backend materializes the environment.
The name must be in the plugin's resolvableWorkerEnvVars allowlist — a
sandbox environment value has no way to say "leave this one out", so any other
name fails the Activity non-retryably with a WorkerEnvValueError, naming the
variable. An allowlisted variable that is unset or empty reads as the empty
string.
new Manifest({ environment: { DB_PASSWORD: workerEnvValue('WORKER_DB_PASSWORD') } })
Parameters
| Name | Type |
|---|---|
name | string |
Returns
EnvValueReference