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