### Internal: Get Start Method Type Annotations Source: https://python.temporal.io/temporalio.nexus._util.html Internal utility to get input and output type annotations for a start method, given expected parameter types. ```python def _get_start_method_input_and_output_type_annotations(start: Callable[..., Any], *, expected_param_types: tuple[type[Any], ...]) -> tuple[type[Any] | None, type[Any] | None]: hints = get_type_hints(start, include_extras=True) return hints.get(expected_param_types[0]), hints.get(expected_param_types[1]) ``` -------------------------------- ### Start Activity Input Source: https://python.temporal.io/temporalio.worker.StartActivityInput.html Input structure for starting an activity. ```APIDOC ## StartActivityInput ### Description Input parameters for starting a new activity. ### Attributes - `activity` (callable) - The activity function. - `activity_id` (string) - The unique ID for the activity. - `arg_types` (list) - Types of the arguments. - `args` (list) - Arguments for the activity. - `cancellation_type` (CancellationType) - Type of cancellation. - `disable_eager_execution` (boolean) - Whether to disable eager execution. - `headers` (dict) - Headers to include. - `heartbeat_timeout` (timedelta) - Timeout for heartbeats. - `priority` (int) - Priority of the activity. - `ret_type` - Return type of the activity. - `retry_policy` (RetryPolicy) - Policy for retrying the activity. - `schedule_to_close_timeout` (timedelta) - Timeout from schedule to close. - `schedule_to_start_timeout` (timedelta) - Timeout from schedule to start. - `start_to_close_timeout` (timedelta) - Timeout from start to close. - `summary` (string) - A summary of the activity. - `task_queue` (string) - The task queue for the activity. - `versioning_intent` (VersioningIntent) - Intent for versioning. ``` -------------------------------- ### Start Activity Source: https://python.temporal.io/temporalio.client.ScheduleListDescription.html Starts an activity execution. ```APIDOC ## POST /api/v1/namespaces/{namespace}/activities/start ### Description Starts an activity execution. ### Method POST ### Endpoint /api/v1/namespaces/{namespace}/activities/start ### Parameters #### Request Body - **activityId** (string) - Required - The unique ID for the activity. - **activityType** (string) - Required - The type of the activity. - **taskQueue** (string) - Required - The task queue to use for the activity. - **workflowId** (string) - Required - The ID of the workflow this activity belongs to. - **workflowRunId** (string) - Required - The run ID of the workflow this activity belongs to. - **input** (any) - Optional - The input for the activity. - **rpc_metadata** (object) - Optional - Metadata for the RPC call. - **rpc_timeout** (Duration) - Optional - Timeout for the RPC call. ### Request Example { "activityId": "activity-123", "activityType": "MyActivity", "taskQueue": "my-task-queue", "workflowId": "workflow-123", "workflowRunId": "run-abc-123", "input": { "data": "process" } } ### Response #### Success Response (200) - **activityId** (string) - The ID of the started activity. #### Response Example { "activityId": "activity-123" } ``` -------------------------------- ### Start Local Activity Input Source: https://python.temporal.io/temporalio.worker.WorkerTuner.html Input structure for starting a local activity. ```APIDOC ## Class StartLocalActivityInput ### Description Input parameters for starting a local activity. ### Attributes - `activity` (object) - The activity object. - `activity_id` (string) - The ID of the local activity. - `arg_types` (list) - The types of the arguments. - `args` (list) - The arguments for the local activity. - `cancellation_type` (string) - The cancellation type. - `headers` (dict) - Headers to include. - `local_retry_threshold` (int) - Local retry threshold. - `ret_type` (object) - The return type of the activity. - `retry_policy` (object) - The retry policy for the activity. - `schedule_to_close_timeout` (int) - Schedule to close timeout in seconds. - `schedule_to_start_timeout` (int) - Schedule to start timeout in seconds. - `start_to_close_timeout` (int) - Start to close timeout in seconds. - `summary` (string) - A summary of the local activity. ``` -------------------------------- ### Start Activity Execution Source: https://python.temporal.io/temporalio.service.OperatorService.html Starts an activity execution. ```APIDOC ## start_activity_execution ### Description Starts an activity execution. ### Method POST ### Endpoint /temporal.api.operatorservice.v1.OperatorService/StartActivityExecution ### Parameters (No query parameters) ### Request Body - **namespace** (string) - Required - The namespace of the workflow execution. - **workflowId** (string) - Required - The ID of the workflow execution. - **runId** (string) - Required - The run ID of the workflow execution. - **activityId** (string) - Required - The ID of the activity execution to start. - **activityType** (object) - Required - The type of the activity. - **name** (string) - Required - The name of the activity type. - **input** (object) - Optional - The input for the activity. - **payloads** (array) - Optional - The payloads for the input. - **scheduleToCloseTimeout** (string) - Optional - The schedule-to-close timeout for the activity. - **startToCloseTimeout** (string) - Optional - The start-to-close timeout for the activity. - **heartbeatTimeout** (string) - Optional - The heartbeat timeout for the activity. ### Response #### Success Response (200) (No response body) #### Response Example (No response body) ``` -------------------------------- ### Start Activity Execution Source: https://python.temporal.io/temporalio.service._BridgeServiceClient.html Starts an activity execution. ```APIDOC ## start_activity_execution ### Description Starts an activity execution. ### Method Not specified (assumed to be a client method call) ### Endpoint Not specified ``` -------------------------------- ### Start Activity Class Source: https://python.temporal.io/temporalio.client.PendingActivityState.html Starts a new activity execution using a class. This is an alternative way to start activities. ```APIDOC ## start_activity_class ### Description Starts a new activity execution using a provided class. ### Method Not specified (assumed to be a client method call) ### Endpoint Not applicable (client SDK method) ### Parameters Accepts parameters to define the activity, including the activity class, arguments, and task queue. ### Request Example ```python # Example usage await client.start_activity_class( ... ) ``` ### Response Returns a handle or identifier for the started activity. ``` -------------------------------- ### Start Local Activity (No Param) Source: https://python.temporal.io/temporalio.workflow._activities.html Starts a local activity that takes no parameters. Supports both asynchronous and synchronous activity functions. ```python def start_local_activity(activity: "CallableAsyncNoParam[ReturnType]", *, schedule_to_close_timeout: "timedelta | None" = None, schedule_to_start_timeout: "timedelta | None" = None, start_to_close_timeout: "timedelta | None" = None, retry_policy: "temporalio.common.RetryPolicy | None" = None, local_retry_threshold: "timedelta | None" = None, cancellation_type: "ActivityCancellationType" = ActivityCancellationType.TRY_CANCEL, activity_id: "str | None" = None, summary: "str | None" = None) -> "ActivityHandle[ReturnType]" ``` ```python def start_local_activity(activity: "CallableSyncNoParam[ReturnType]", *, activity_id: "str | None" = None, schedule_to_close_timeout: "timedelta | None" = None, schedule_to_start_timeout: "timedelta | None" = None, start_to_close_timeout: "timedelta | None" = None, retry_policy: "temporalio.common.RetryPolicy | None" = None, local_retry_threshold: "timedelta | None" = None, cancellation_type: "ActivityCancellationType" = ActivityCancellationType.TRY_CANCEL, summary: "str | None" = None) -> "ActivityHandle[ReturnType]" ``` -------------------------------- ### Start Activity Source: https://python.temporal.io/temporalio.workflow._activities.html Start a remote activity and return an ActivityHandle. The activity will run on the specified task queue. ```python def start_activity(activity: `CallableAsyncNoParam[ReturnType]`, *, task_queue: `str | None` = None, schedule_to_close_timeout: `timedelta | None` = None, schedule_to_start_timeout: `timedelta | None` = None, start_to_close_timeout: `timedelta | None` = None, heartbeat_timeout: `timedelta | None` = None, retry_policy: `temporalio.common.RetryPolicy | None` = None, cancellation_type: `ActivityCancellationType` = ActivityCancellationType.TRY_CANCEL, activity_id: `str | None` = None, versioning_intent: `VersioningIntent | None` = None, summary: `str | None` = None, priority: `temporalio.common.Priority` = temporalio.common.Priority.default) -> `ActivityHandle[ReturnType]`: ``` -------------------------------- ### Start Local Activity Input Source: https://python.temporal.io/temporalio.worker.ReplayerConfig.html Input parameters for starting a local activity, including timeouts and retry policies. ```APIDOC ## StartLocalActivityInput ### Description Input parameters required to start a local activity. ### Attributes * `activity` - The activity definition. * `activity_id` (string) - The unique ID of the local activity. * `arg_types` (list) - The types of the arguments. * `args` (list) - The arguments for the local activity. * `cancellation_type` - The type of cancellation. * `headers` (dict) - Headers for the local activity. * `local_retry_threshold` (timedelta) - Threshold for local retries. * `ret_type` - The return type of the local activity. * `retry_policy` - The retry policy for the local activity. * `schedule_to_close_timeout` (timedelta) - Timeout from schedule to close. * `schedule_to_start_timeout` (timedelta) - Timeout from schedule to start. * `start_to_close_timeout` (timedelta) - Timeout from start to close. * `summary` (string) - A summary of the local activity. ``` -------------------------------- ### Start Activity Source: https://python.temporal.io/temporalio.client.ActivityExecution.html Initiates a new activity execution. This is the primary method for starting an activity. ```APIDOC ## start_activity ### Description Starts a new activity execution. ### Method POST ### Endpoint /api/v1/namespaces/{namespace}/workflows/{workflow_id}/activities ### Parameters #### Path Parameters - **namespace** (string) - Required - The namespace where the workflow resides. - **workflow_id** (string) - Required - The ID of the workflow to which the activity belongs. #### Query Parameters - **activity_id** (string) - Optional - A unique identifier for the activity. - **activity_type** (string) - Required - The type of the activity to execute. #### Request Body - **arguments** (array) - Optional - Arguments to pass to the activity function. - **schedule_to_close_timeout** (string) - Optional - The maximum duration for the activity to be scheduled and closed. - **start_to_close_timeout** (string) - Optional - The maximum duration for the activity to run from start to close. - **schedule_to_start_timeout** (string) - Optional - The maximum duration for the activity to be scheduled before it starts. - **heartbeat_timeout** (string) - Optional - The interval at which the activity should send heartbeats. - **retry_policy** (object) - Optional - The policy for retrying the activity if it fails. - **initial_interval** (string) - Required - The initial interval for retries. - **backoff_coefficient** (number) - Required - The coefficient for backoff. - **maximum_interval** (string) - Required - The maximum interval between retries. - **maximum_attempts** (integer) - Optional - The maximum number of retry attempts. - **non_retryable_error_types** (array) - Optional - A list of error types that should not trigger a retry. - **task_queue** (string) - Required - The task queue to which the activity should be dispatched. - **rpc_metadata** (object) - Optional - Metadata for the RPC call. ### Request Example ```json { "arguments": [ "input1", 123 ], "schedule_to_close_timeout": "60s", "start_to_close_timeout": "30s", "heartbeat_timeout": "10s", "retry_policy": { "initial_interval": "1s", "backoff_coefficient": 2, "maximum_interval": "10s", "maximum_attempts": 5, "non_retryable_error_types": ["SpecificError"] }, "task_queue": "my-task-queue" } ``` ### Response #### Success Response (200) - **activity_id** (string) - The ID of the started activity. #### Response Example ```json { "activity_id": "activity-123-abc" } ``` ``` -------------------------------- ### Create and Use Nexus Client Source: https://python.temporal.io/temporalio.workflow._nexus.NexusClient.html Example of creating a Nexus client and using it to start and get the result of a Nexus operation. This requires defining the Nexus endpoint, service, and operation details. ```python nexus_client = workflow.create_nexus_client( endpoint=my_nexus_endpoint, service=MyService, ) handle = await nexus_client.start_operation( operation=MyService.my_operation, input=MyOperationInput(value="hello"), schedule_to_close_timeout=timedelta(seconds=10), ) result = await handle.result() ``` -------------------------------- ### __init__ Method (StartNexusOperationInput) Source: https://python.temporal.io/temporalio.worker.SlotPermit.html Initializes the StartNexusOperationInput class. ```APIDOC ## __init__ Method (StartNexusOperationInput) ### Description Initializes a new StartNexusOperationInput instance. ### Parameters #### Request Body - `operation` (str) - Required - The Nexus operation name. - `endpoint` (str) - Required - The Nexus operation endpoint. - `service` (str) - Required - The service hosting the operation. - `input` (any) - Optional - Input payload. - `cancellation_type` (CancellationType) - Optional - Cancellation type. - `headers` (dict) - Optional - Custom headers. - `schedule_to_close_timeout` (timedelta) - Optional - Schedule to close timeout. - `schedule_to_start_timeout` (timedelta) - Optional - Schedule to start timeout. - `start_to_close_timeout` (timedelta) - Optional - Start to close timeout. - `summary` (str) - Optional - Summary. - `output_type` (str) - Optional - Expected output type. - `operation_name` (str) - Optional - Operation name. ``` -------------------------------- ### __post_init__ Method (StartNexusOperationInput) Source: https://python.temporal.io/temporalio.worker.SlotPermit.html Post-initialization hook for StartNexusOperationInput. ```APIDOC ## __post_init__ Method (StartNexusOperationInput) ### Description Performs additional setup after the initial object creation for Nexus operations. ``` -------------------------------- ### Start Activity Execution Source: https://python.temporal.io/temporalio.bridge.services_generated.TestService.html Starts an activity execution. Initiates the execution of a new activity. ```APIDOC ## start_activity_execution ### Description Starts an activity execution. ### Method POST ### Endpoint /start_activity_execution ``` -------------------------------- ### __init__ Method (StartLocalActivityInput) Source: https://python.temporal.io/temporalio.worker.SlotPermit.html Initializes the StartLocalActivityInput class. ```APIDOC ## __init__ Method (StartLocalActivityInput) ### Description Initializes a new StartLocalActivityInput instance. ### Parameters #### Request Body - `activity` (str) - Required - Local activity name. - `activity_id` (str) - Required - Unique local activity ID. - `arg_types` (list) - Optional - Argument types. - `args` (list) - Optional - Arguments. - `cancellation_type` (CancellationType) - Optional - Cancellation type. - `headers` (dict) - Optional - Custom headers. - `local_retry_threshold` (timedelta) - Optional - Local retry threshold. - `ret_type` (str) - Optional - Return type. - `retry_policy` (RetryPolicy) - Optional - Retry policy. - `schedule_to_close_timeout` (timedelta) - Optional - Schedule to close timeout. - `schedule_to_start_timeout` (timedelta) - Optional - Schedule to start timeout. - `start_to_close_timeout` (timedelta) - Optional - Start to close timeout. - `summary` (str) - Optional - Summary. ``` -------------------------------- ### Internal: Get Wrapped Start Method Type Annotations Source: https://python.temporal.io/temporalio.nexus._util.html Internal utility to get input and output type annotations for a wrapped start method, considering expected parameter types and return origin. ```python def _get_wrapped_start_method_input_and_output_type_annotations(start: Callable[..., Any], *, expected_param_types: tuple[type[Any], ...], expected_return_origin: type[Any]) -> tuple[type[Any] | None, type[Any] | None]: hints = get_type_hints(start, include_extras=True) return hints.get(expected_param_types[0]), hints.get(expected_return_origin) ``` -------------------------------- ### Start Activity Input Source: https://python.temporal.io/temporalio.worker.ReplayerConfig.html Input parameters for starting an activity, including timeouts, retry policies, and task queue. ```APIDOC ## StartActivityInput ### Description Input parameters required to start an activity. ### Attributes * `activity` - The activity definition. * `activity_id` (string) - The unique ID of the activity. * `arg_types` (list) - The types of the arguments. * `args` (list) - The arguments for the activity. * `cancellation_type` - The type of cancellation. * `disable_eager_execution` (boolean) - Disables eager execution. * `headers` (dict) - Headers for the activity. * `heartbeat_timeout` (timedelta) - Timeout for heartbeats. * `priority` (integer) - Priority of the activity. * `ret_type` - The return type of the activity. * `retry_policy` - The retry policy for the activity. * `schedule_to_close_timeout` (timedelta) - Timeout from schedule to close. * `schedule_to_start_timeout` (timedelta) - Timeout from schedule to start. * `start_to_close_timeout` (timedelta) - Timeout from start to close. * `summary` (string) - A summary of the activity. * `task_queue` (string) - The task queue for the activity. * `versioning_intent` - The versioning intent for the activity. ``` -------------------------------- ### Get Workflow Run Start Method Input/Output Types Source: https://python.temporal.io/temporalio.nexus._util.html Extracts input and output types from a workflow run start method. The start method must be type-annotated and return WorkflowHandle. ```python def get_workflow_run_start_method_input_and_output_type_annotations(start: Callable[[NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[WorkflowHandle[OutputT]]]) -> tuple[type[InputT] | None, type[OutputT] | None]: return get_type_hints(start, include_extras=True).get("return"), get_type_hints(start, include_extras=True).get("return").__args__[0].__args__[2] ``` -------------------------------- ### StartArgs Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.HydrateWorkspaceArgs.html Arguments for starting a process. ```APIDOC ## StartArgs ### Description Arguments for starting a process. ### Inherited Attributes - **state** (_HasState) - Undocumented ``` -------------------------------- ### StartArgs Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.PersistWorkspaceArgs.html Arguments for starting a process. ```APIDOC ## StartArgs ### Description Arguments for starting a process. ### Inherited Attributes - **state** (Undocumented) - Inherited from `_HasState`. ### Inherited Methods - **_coerce_state** - Inherited from `_HasState`. ``` -------------------------------- ### Get Temporal Operation Start Method Input/Output Types Source: https://python.temporal.io/temporalio.nexus._util.html Extracts input and output types from a Temporal operation start method. The start method must be type-annotated and return TemporalOperationResult. ```python def get_temporal_operation_start_method_input_and_output_type_annotations(start: Callable[[NexusServiceType, TemporalStartOperationContext, TemporalNexusClient, InputT], Awaitable[TemporalOperationResult[OutputT]]]) -> tuple[type[InputT] | None, type[OutputT] | None]: return get_type_hints(start, include_extras=True).get("return"), get_type_hints(start, include_extras=True).get("return").__args__[0].__args__[3] ``` -------------------------------- ### StartArgs Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.ResumeSessionArgs.html Arguments for starting a session. ```APIDOC ## StartArgs ### Description Arguments for starting a session. ### Inherited Attributes - **state** (Undocumented) - Inherited from `_HasState`. ### Inherited Methods - **_coerce_state** - Inherited from `_HasState`. ``` -------------------------------- ### temporalio.nexus._util.get_workflow_run_start_method_input_and_output_type_annotations Source: https://python.temporal.io/nameIndex.html Internal utility to get type annotations for workflow run start methods. ```APIDOC ## get_workflow_run_start_method_input_and_output_type_annotations nexus_util ### Description Internal utility function to retrieve type annotations for the input and output of a workflow run start method. This is not intended for direct user invocation. ### Method Not applicable (Internal SDK function) ### Endpoint Not applicable (Internal SDK function) ### Parameters None explicitly documented for public use. ### Request Example ```python # This is an internal utility function and should not be called directly by users. ``` ### Response Details not available for public API. ``` -------------------------------- ### WorkflowHandle.get_update_handle_for Source: https://python.temporal.io/temporalio.client.WorkflowHandle.html Get an update handle for a specific update. This method is used to retrieve a handle for an update that has been started. ```APIDOC ## WorkflowHandle.get_update_handle_for ### Description Get an update handle for a specific update. This method is used to retrieve a handle for an update that has been started. ### Method `get_update_handle_for` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python update_handle = workflow_handle.get_update_handle_for(update_id="update_id_456") ``` ### Response #### Success Response (200) Returns an `UpdateHandle` object. #### Response Example ```json { "update_id": "update_id_456" } ``` ``` -------------------------------- ### __init__ Method (StartActivityInput) Source: https://python.temporal.io/temporalio.worker.SlotPermit.html Initializes the StartActivityInput class. ```APIDOC ## __init__ Method (StartActivityInput) ### Description Initializes a new StartActivityInput instance. ### Parameters #### Request Body - `activity` (str) - Required - Activity name. - `activity_id` (str) - Required - Unique activity ID. - `arg_types` (list) - Optional - Argument types. - `args` (list) - Optional - Arguments. - `cancellation_type` (CancellationType) - Optional - Cancellation type. - `disable_eager_execution` (bool) - Optional - Disable eager execution. - `headers` (dict) - Optional - Custom headers. - `heartbeat_timeout` (timedelta) - Optional - Heartbeat timeout. - `priority` (int) - Optional - Priority. - `ret_type` (str) - Optional - Return type. - `retry_policy` (RetryPolicy) - Optional - Retry policy. - `schedule_to_close_timeout` (timedelta) - Optional - Schedule to close timeout. - `schedule_to_start_timeout` (timedelta) - Optional - Schedule to start timeout. - `start_to_close_timeout` (timedelta) - Optional - Start to close timeout. - `summary` (str) - Optional - Summary. - `task_queue` (str) - Optional - Task queue. - `versioning_intent` (VersioningIntent) - Optional - Versioning intent. ``` -------------------------------- ### Nexus Operation Management Source: https://python.temporal.io/temporalio.client.ScheduleRange.html Methods for managing Nexus operations, including starting, getting results, and terminating. ```APIDOC ## Nexus Operation Management Methods ### `start_nexus_operation` Starts a Nexus operation. ### `get_nexus_operation_result` Retrieves the result of a Nexus operation. ### `cancel_nexus_operation` Cancels a Nexus operation. ### `terminate_nexus_operation` Terminates a Nexus operation. ### `describe_nexus_operation` Retrieves details about a Nexus operation. ### `list_nexus_operations` Lists Nexus operations. ``` -------------------------------- ### Client.__init__ Source: https://python.temporal.io/temporalio.bridge.client.Client.html Initializes the client with an underlying SDK Core reference. This method is used internally to set up the client instance. ```APIDOC ## Client.__init__ ### Description Initialize client with underlying SDK Core reference. ### Method Method ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * `runtime` (`temporalio.bridge.runtime.Runtime`) - The runtime environment. * `ref` (`temporalio.bridge.temporal_sdk_bridge.ClientRef`) - The SDK Core client reference. ### Returns None ``` -------------------------------- ### Get Operation Factory Source: https://python.temporal.io/temporalio.nexus._util.html Retrieves the nexusrpc.Operation for an object and its factory function. The object should be a decorated operation start method. ```python def get_operation_factory(obj: Any) -> tuple[Callable[[Any], Any] | None, nexusrpc.Operation[Any, Any] | None]: return getattr(obj, "__nexus_operation_factory", (None, None)) ``` -------------------------------- ### ExecuteNexusOperationStart Method Source: https://python.temporal.io/temporalio.worker.SharedStateManager.html Starts a new Nexus operation. ```APIDOC ## POST /execute_nexus_operation_start ### Description Initiates a new Nexus operation with the provided input. ### Method POST ### Endpoint `/execute_nexus_operation_start` ### Parameters #### Request Body - `input` (object) - Required - The input payload for the Nexus operation. - `operation` (string) - Required - The name of the operation to start. - `service` (string) - Required - The service where the operation resides. - `endpoint` (string) - Optional - The specific endpoint for the operation. - `headers` (object) - Optional - Custom headers for the request. - `schedule_to_close_timeout` (string) - Optional - Timeout for the operation to close. - `schedule_to_start_timeout` (string) - Optional - Timeout for the operation to start. - `start_to_close_timeout` (string) - Optional - Timeout from start to close. - `summary` (string) - Optional - A summary of the operation. - `output_type` (string) - Optional - The expected type of the operation's output. - `operation_name` (string) - Optional - An alternative name for the operation. ``` -------------------------------- ### Workflow Execution Methods Source: https://python.temporal.io/temporalio.client.WorkflowHandle.html Methods for executing and managing workflows, including starting, getting handles, and handling updates. ```APIDOC ## Workflow Execution ### `execute_workflow` Starts a workflow execution. This is a high-level method that handles the entire lifecycle of starting and waiting for a workflow. ### `start_workflow` Starts a workflow execution without waiting for it to complete. Returns a `WorkflowHandle`. ### `execute_update_with_start_workflow` Starts a workflow and then immediately executes an update on it. This is a convenience method for starting a workflow and performing an update in a single atomic operation. ### `start_update_with_start_workflow` Starts a workflow and then immediately executes an update on it without waiting for the update to complete. Returns a `WorkflowHandle`. ### `get_workflow_handle` Gets a handle to an existing workflow execution by its workflow ID. ### `get_workflow_handle_for` Gets a handle to an existing workflow execution by its workflow ID and run ID. ### `get_activity_handle` Gets a handle to an activity that is part of a workflow execution. ### `get_async_activity_handle` Gets an asynchronous handle to an activity that is part of a workflow execution. ### `start_activity` Starts a single activity execution within a workflow. ### `start_activity_class` Starts an activity execution using a class reference. ### `start_activity_method` Starts an activity execution using a method reference. ### `list_workflows` Lists workflow executions based on a query. ### `describe_workflow` Retrieves details about a specific workflow execution. ### `fetch_workflow_history_events` Fetches the history events for a workflow execution. ``` -------------------------------- ### Decorate Temporal Operation Handler Source: https://python.temporal.io/temporalio.nexus.html Use the `temporal_operation` decorator to mark a method as the starting point for a Nexus operation that interacts with Temporal. This decorator handles the setup and teardown of the operation context. ```python from temporalio.nexus import temporal_operation @temporal_operation def start_my_temporal_operation(input_data): # Operation logic here pass ``` -------------------------------- ### StartArgs Class Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.ReadResult.html Arguments for starting a process. ```APIDOC ## StartArgs Class ### Description Arguments for starting a process. ### Inherited Attributes - **state** (Any) - Undocumented ``` -------------------------------- ### StartLocalActivityInput Source: https://python.temporal.io/temporalio.worker.ActivityOutboundInterceptor.html Input structure for starting a local activity. ```APIDOC ## StartLocalActivityInput ### Description Defines the input required to start a local activity. ### Attributes - `activity` - `activity_id` - `arg_types` - `args` - `cancellation_type` - `headers` - `local_retry_threshold` - `ret_type` - `retry_policy` - `schedule_to_close_timeout` - `schedule_to_start_timeout` - `start_to_close_timeout` - `summary` ``` -------------------------------- ### Using Tracing Context Outside Worker Source: https://python.temporal.io/temporalio.contrib.openai_agents.OpenAIAgentsPlugin.html Use this context manager when starting traces and spans outside of a worker. It ensures that OpenAI Agents tracing instrumentation is correctly set up. This example demonstrates its use with external trace and span contexts. ```python with env.openai_agents_plugin.tracing_context(): with trace("External trace"): with custom_span("External span"): workflow_handle = await new_client.start_workflow( ... ) ``` -------------------------------- ### Start Nexus Operation with Operation Handler Factory Source: https://python.temporal.io/temporalio.client.NexusClient.html Initiates a Nexus operation by providing a function that acts as a factory for an OperationHandler. This factory receives the Nexus service type and is responsible for returning an OperationHandler instance. This pattern is useful for complex setup or dependency injection for the operation handler. ```python async def start_operation(self, operation: Callable[[NexusServiceType], nexusrpc.handler.OperationHandler[InputT, OutputT]]], arg: InputT, *, id: str, id_reuse_policy: temporalio.common.NexusOperationIDReusePolicy = temporalio.common.NexusOperationIDReusePolicy.ALLOW_DUPLICATE, id_conflict_policy: temporalio.common.NexusOperationIDConflictPolicy = temporalio.common.NexusOperationIDConflictPolicy.FAIL, schedule_to_close_timeout: timedelta | None = None, schedule_to_start_timeout: timedelta | None = None, start_to_close_timeout: timedelta | None = None, search_attributes: temporalio.common.TypedSearchAttributes | None = None, summary: str | None = None, headers: Mapping[str, str] | None = None, rpc_metadata: Mapping[str, str | bytes] = {}, rpc_timeout: timedelta | None = None) -> NexusOperationHandle[OutputT]: ``` -------------------------------- ### StartArgs Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.html Arguments for the start activity. ```APIDOC ## StartArgs ### Description Arguments for the start activity. ### Parameters #### Request Body - **state** (object) - Optional - The state of the start operation. ``` -------------------------------- ### Start Workflow Update With Start Source: https://python.temporal.io/temporalio.client._ClientImpl.html Starts a workflow update that also starts the workflow if it's not already running. ```APIDOC ## start_update_with_start_workflow ### Description Starts a workflow update that also starts the workflow if it's not already running. ### Method POST ### Endpoint `/namespaces/{namespace}/workflows/{workflow_id}/update-with-start` ### Parameters #### Path Parameters - **namespace** (string) - Required - The namespace of the workflow. - **workflow_id** (string) - Required - The ID of the workflow. #### Query Parameters - **run_id** (string) - Optional - The specific run ID of the workflow. #### Request Body - **update_name** (string) - Required - The name of the update. - **workflow_type** (string) - Required - The type of the workflow. - **task_queue** (string) - Required - The task queue for the workflow. - **arguments** (list) - Optional - Arguments for the update. - **first_execution_run_id** (string) - Optional - The run ID of the first execution if continuing. - **first_execution_run_id_time** (string) - Optional - The timestamp of the first execution run ID. - **retry_policy** (object) - Optional - The retry policy for the workflow. - **cron_schedule** (string) - Optional - A cron schedule for recurring workflows. - **memo** (object) - Optional - Memo to attach to the workflow. - **search_attributes** (object) - Optional - Search attributes for the workflow. - **execution_timeout** (string) - Optional - The total timeout for workflow execution. - **run_timeout** (string) - Optional - The timeout for a single workflow run. - **task_timeout** (string) - Optional - The timeout for a single task. - **id_reuse_policy** (string) - Optional - Policy for reusing workflow IDs. ### Response #### Success Response (200) - **update_id** (string) - The ID of the workflow update. - **workflow_id** (string) - The ID of the workflow. - **run_id** (string) - The ID of the workflow run. #### Response Example ```json { "update_id": "update-xyz", "workflow_id": "workflow-123", "run_id": "run-abc" } ``` ``` -------------------------------- ### Start Update With Start Workflow Source: https://python.temporal.io/temporalio.client.UpdateWithStartUpdateWorkflowInput.html Initiates a workflow update and starts the workflow if it does not exist. This is useful for starting a workflow with an update request. ```APIDOC ## start_update_with_start_workflow ### Description Starts a workflow and immediately begins an update on it. If the workflow already exists, this call will fail. ### Method POST ### Endpoint `/api/v1/workflow/update/start` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **workflow_id** (string) - Required - The ID of the workflow to start. - **workflow_type** (string) - Required - The type of the workflow. - **update_id** (string) - Required - The ID of the update. - **update_payload** (object) - Required - The payload for the update. - **workflow_run_timeout** (string) - Optional - The timeout for the workflow run. - **workflow_task_timeout** (string) - Optional - The timeout for workflow tasks. - **retry_policy** (object) - Optional - The retry policy for the workflow. - **cron_schedule** (string) - Optional - The cron schedule for the workflow. - **memo** (object) - Optional - Memo for the workflow. - **search_attributes** (object) - Optional - Search attributes for the workflow. - **typed_search_attributes** (object) - Optional - Typed search attributes for the workflow. - **run_timeout** (string) - Optional - Alias for workflow_run_timeout. - **task_timeout** (string) - Optional - Alias for workflow_task_timeout. - **identity** (string) - Optional - The identity of the client. - **first_execution_run_id** (string) - Optional - The run ID of the first execution. - **request_timeout** (string) - Optional - The timeout for the request. - **namespace** (string) - Optional - The namespace for the workflow. - **data_converter** (object) - Optional - The data converter to use. ### Request Example ```json { "workflow_id": "my-workflow-id", "workflow_type": "MyWorkflow", "update_id": "my-update-id", "update_payload": { "field1": "value1" }, "workflow_run_timeout": "60s", "workflow_task_timeout": "10s" } ``` ### Response #### Success Response (200) - **update_handle** (object) - The handle for the initiated update. #### Response Example ```json { "update_handle": { "id": "my-update-id", "workflow_id": "my-workflow-id", "workflow_run_id": "my-run-id" } } ``` ``` -------------------------------- ### TemporalSandboxSession.start Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_sandbox_session.TemporalSandboxSession.html Start the sandbox session via Temporal activity. ```APIDOC ## POST /TemporalSandboxSession/start ### Description Start the sandbox session via activity. ### Method POST ### Endpoint /TemporalSandboxSession/start ### Parameters None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### Start Local Activity Class (Multiple Params Async) Source: https://python.temporal.io/temporalio.workflow._activities.html Starts a local activity defined as an asynchronous class with multiple parameters using `args`. Returns an `ActivityHandle` for managing the activity. ```python def start_local_activity_class(activity: type[Callable[..., Awaitable[ReturnType]]], *, args: Sequence[Any], schedule_to_close_timeout: timedelta | None = None, schedule_to_start_timeout: timedelta | None = None, start_to_close_timeout: timedelta | None = None, retry_policy: temporalio.common.RetryPolicy | None = None, local_retry_threshold: timedelta | None = None, cancellation_type: ActivityCancellationType = ActivityCancellationType.TRY_CANCEL, activity_id: str | None = None) -> ActivityHandle[ReturnType]: ``` -------------------------------- ### Start Update With Start Workflow Source: https://python.temporal.io/temporalio.client.ScheduleAsyncIterator.html Starts an update with the given workflow. ```APIDOC ## start_update_with_start_workflow ### Description Starts an update with the given workflow. ### Method Not specified (assumed to be a client method call) ### Parameters #### Path Parameters - **workflow_id** (string) - Required - The ID of the workflow to start the update with. #### Request Body - **update_id** (string) - Required - The ID of the update. - **workflow_type** (string) - Required - The type of the workflow. - **arguments** (any) - Optional - Arguments for the workflow. - **task_queue** (string) - Required - The task queue for the workflow. - **rpc_metadata** (object) - Optional - Metadata for the RPC call. - **rpc_timeout** (int) - Optional - Timeout for the RPC call in milliseconds. ### Response #### Success Response (200) - **update_id** (string) - The ID of the started update. ``` -------------------------------- ### Start Update with Start Workflow Source: https://python.temporal.io/temporalio.client.WorkflowExecutionStatus.html Starts an update for a workflow that is also being started. This is used for workflows that require an initial update upon creation. ```APIDOC ## start_update_with_start_workflow ### Description Starts an update for a workflow that is also being started. This is used for workflows that require an initial update upon creation. ### Method POST ### Endpoint /startUpdateWithStartWorkflow ### Parameters #### Query Parameters - **workflow_id** (string) - Required - The ID of the workflow to start and update. - **workflow_type** (string) - Required - The type of the workflow. - **task_queue** (string) - Required - The task queue for the workflow. - **update_id** (string) - Required - The ID of the update. #### Request Body - **arguments** (list) - Optional - Arguments for the workflow. - **update_arguments** (list) - Optional - Arguments for the update. - **cron_schedule** (string) - Optional - Cron schedule for the workflow. - **execution_timeout** (string) - Optional - Execution timeout for the workflow. - **rpc_metadata** (object) - Optional - RPC metadata. - **rpc_timeout** (string) - Optional - RPC timeout. - **search_attributes** (object) - Optional - Search attributes for the workflow. - **start_timeout** (string) - Optional - Start timeout for the workflow. - **typed_workflow_run_timeout** (string) - Optional - Typed workflow run timeout. - **update_timeout** (string) - Optional - Timeout for the update. - **workflow_run_timeout** (string) - Optional - Workflow run timeout. ### Response #### Success Response (200) - **run_id** (string) - The ID of the workflow run. - **update_run_id** (string) - The ID of the update run. #### Response Example { "run_id": "workflow-run-id-123", "update_run_id": "update-run-id-456" } ``` -------------------------------- ### Start Local Activity (Multiple Args) Source: https://python.temporal.io/temporalio.workflow._activities.html Starts a local activity that accepts multiple arguments. Supports both asynchronous and synchronous activity functions. ```python def start_local_activity(activity: "Callable[..., Awaitable[ReturnType]]", *, args: "Sequence[Any]", schedule_to_close_timeout: "timedelta | None" = None, schedule_to_start_timeout: "timedelta | None" = None, start_to_close_timeout: "timedelta | None" = None, retry_policy: "temporalio.common.RetryPolicy | None" = None, local_retry_threshold: "timedelta | None" = None, cancellation_type: "ActivityCancellationType" = ActivityCancellationType.TRY_CANCEL, activity_id: "str | None" = None, summary: "str | None" = None) -> "ActivityHandle[ReturnType]" ``` ```python def start_local_activity(activity: "Callable[..., ReturnType]", *, args: "Sequence[Any]", schedule_to_close_timeout: "timedelta | None" = None, schedule_to_start_timeout: "timedelta | None" = None, start_to_close_timeout: "timedelta | None" = None, retry_policy: "temporalio.common.RetryPolicy | None" = None, local_retry_threshold: "timedelta | None" = None, cancellation_type: "ActivityCancellationType" = ActivityCancellationType.TRY_CANCEL, activity_id: "str | None" = None, summary: "str | None" = None) -> "ActivityHandle[ReturnType]" ``` -------------------------------- ### Start Update With Start Workflow Source: https://python.temporal.io/temporalio.client.ActivityExecutionDescription.html Starts a workflow and immediately begins an update. This is useful for workflows that require an initial update upon starting. ```APIDOC ## start_update_with_start_workflow ### Description Starts a workflow and immediately begins an update. This is useful for workflows that require an initial update upon starting. ### Method POST ### Endpoint /api/v1/workflows/start_update ### Parameters #### Request Body - **workflowName** (string) - Required - The name of the workflow to start. - **updateName** (string) - Required - The name of the update to start. - **input** (any) - Optional - The input for the workflow. - **updateInput** (any) - Optional - The input for the update. ``` -------------------------------- ### StartArgs Class Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.SessionResult.html Arguments for starting a new session. ```APIDOC ## StartArgs Class ### Description Arguments for starting a new session. ### Attributes - **state** (Undocumented) - Undocumented (Inherited from _HasState) ### Methods - **_coerce_state** (Undocumented) - Undocumented (Inherited from _HasState) ``` -------------------------------- ### StartArgs Class Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.ReadArgs.html Arguments for starting a process. Inherits state. ```APIDOC ## StartArgs Class ### Description Arguments for starting a process. ### Inherited Attributes - **state** - Undocumented ``` -------------------------------- ### PtyExecStartArgs Class Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.ReadArgs.html Arguments for starting a pseudo-terminal execution. Includes command, shell, timeout, user, and TTY settings. ```APIDOC ## PtyExecStartArgs Class ### Description Arguments for starting a pseudo-terminal execution. ### Attributes - **command** (str) - Undocumented - **max_output_tokens** (int) - Undocumented - **shell** (str) - Undocumented - **timeout** (int) - Undocumented - **tty** (bool) - Undocumented - **user** (str) - Undocumented - **yield_time_s** (float) - Undocumented ### Inherited Attributes - **state** - Undocumented ``` -------------------------------- ### Signal With Start Workflow Execution Source: https://python.temporal.io/temporalio.bridge.services_generated.TestService.html Signals a workflow and starts it if it's not running. Combines signaling and starting a workflow. ```APIDOC ## signal_with_start_workflow_execution ### Description Signals a workflow and starts it if it's not running. ### Method POST ### Endpoint /signal_with_start_workflow_execution/{workflow_id} ``` -------------------------------- ### StartArgs Class Source: https://python.temporal.io/temporalio.contrib.openai_agents.sandbox._temporal_activity_models.StopArgs.html Arguments for starting an activity. Inherits from _HasState. ```APIDOC ## StartArgs Class ### Description Arguments for starting an activity. ### Inherited from `_HasState` #### Class Variables * **state** (Undocumented) - Undocumented ```