├── .github ├── CODEOWNERS └── workflows │ ├── build-binaries.yml │ ├── ci.yml │ ├── nightly.yml │ ├── omes.yml │ └── run-bench.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── pyproject.toml ├── scripts ├── _img │ └── favicon.ico ├── _proto │ ├── Dockerfile │ ├── Dockerfile.dockerignore │ ├── grpc │ │ └── health │ │ │ └── v1 │ │ │ └── health.proto │ └── temporal │ │ └── api │ │ └── common │ │ └── v1 │ │ └── grpc_status.proto ├── gen_docs.py ├── gen_protos.py └── run_bench.py ├── temporalio ├── __init__.py ├── activity.py ├── api │ ├── __init__.py │ ├── activity │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── batch │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── cloud │ │ ├── __init__.py │ │ ├── account │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── message_pb2.py │ │ │ │ └── message_pb2.pyi │ │ ├── cloudservice │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── request_response_pb2.py │ │ │ │ ├── request_response_pb2.pyi │ │ │ │ ├── request_response_pb2_grpc.py │ │ │ │ ├── request_response_pb2_grpc.pyi │ │ │ │ ├── service_pb2.py │ │ │ │ ├── service_pb2.pyi │ │ │ │ ├── service_pb2_grpc.py │ │ │ │ └── service_pb2_grpc.pyi │ │ ├── identity │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── message_pb2.py │ │ │ │ └── message_pb2.pyi │ │ ├── namespace │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── message_pb2.py │ │ │ │ └── message_pb2.pyi │ │ ├── nexus │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── message_pb2.py │ │ │ │ └── message_pb2.pyi │ │ ├── operation │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── message_pb2.py │ │ │ │ └── message_pb2.pyi │ │ ├── region │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── message_pb2.py │ │ │ │ └── message_pb2.pyi │ │ ├── resource │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── message_pb2.py │ │ │ │ └── message_pb2.pyi │ │ ├── sink │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── message_pb2.py │ │ │ │ └── message_pb2.pyi │ │ └── usage │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── cluster │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ ├── message_pb2.pyi │ │ │ ├── message_pb2_grpc.py │ │ │ └── message_pb2_grpc.pyi │ ├── command │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── common │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── grpc_status_pb2.py │ │ │ ├── grpc_status_pb2.pyi │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── deployment │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── enums │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── batch_operation_pb2.py │ │ │ ├── batch_operation_pb2.pyi │ │ │ ├── command_type_pb2.py │ │ │ ├── command_type_pb2.pyi │ │ │ ├── common_pb2.py │ │ │ ├── common_pb2.pyi │ │ │ ├── deployment_pb2.py │ │ │ ├── deployment_pb2.pyi │ │ │ ├── event_type_pb2.py │ │ │ ├── event_type_pb2.pyi │ │ │ ├── failed_cause_pb2.py │ │ │ ├── failed_cause_pb2.pyi │ │ │ ├── namespace_pb2.py │ │ │ ├── namespace_pb2.pyi │ │ │ ├── nexus_pb2.py │ │ │ ├── nexus_pb2.pyi │ │ │ ├── query_pb2.py │ │ │ ├── query_pb2.pyi │ │ │ ├── reset_pb2.py │ │ │ ├── reset_pb2.pyi │ │ │ ├── schedule_pb2.py │ │ │ ├── schedule_pb2.pyi │ │ │ ├── task_queue_pb2.py │ │ │ ├── task_queue_pb2.pyi │ │ │ ├── update_pb2.py │ │ │ ├── update_pb2.pyi │ │ │ ├── workflow_pb2.py │ │ │ └── workflow_pb2.pyi │ ├── errordetails │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── export │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── failure │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── filter │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── history │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── interaction │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── namespace │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── nexus │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── operatorservice │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── request_response_pb2.py │ │ │ ├── request_response_pb2.pyi │ │ │ ├── request_response_pb2_grpc.py │ │ │ ├── request_response_pb2_grpc.pyi │ │ │ ├── service_pb2.py │ │ │ ├── service_pb2.pyi │ │ │ ├── service_pb2_grpc.py │ │ │ └── service_pb2_grpc.pyi │ ├── protocol │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── query │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── replication │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── rules │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── schedule │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── sdk │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── enhanced_stack_trace_pb2.py │ │ │ ├── enhanced_stack_trace_pb2.pyi │ │ │ ├── task_complete_metadata_pb2.py │ │ │ ├── task_complete_metadata_pb2.pyi │ │ │ ├── user_metadata_pb2.py │ │ │ ├── user_metadata_pb2.pyi │ │ │ ├── workflow_metadata_pb2.py │ │ │ └── workflow_metadata_pb2.pyi │ ├── taskqueue │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── testservice │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── request_response_pb2.py │ │ │ ├── request_response_pb2.pyi │ │ │ ├── request_response_pb2_grpc.py │ │ │ ├── request_response_pb2_grpc.pyi │ │ │ ├── service_pb2.py │ │ │ ├── service_pb2.pyi │ │ │ ├── service_pb2_grpc.py │ │ │ └── service_pb2_grpc.pyi │ ├── update │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── version │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ ├── workflow │ │ ├── __init__.py │ │ └── v1 │ │ │ ├── __init__.py │ │ │ ├── message_pb2.py │ │ │ └── message_pb2.pyi │ └── workflowservice │ │ ├── __init__.py │ │ └── v1 │ │ ├── __init__.py │ │ ├── request_response_pb2.py │ │ ├── request_response_pb2.pyi │ │ ├── request_response_pb2_grpc.py │ │ ├── request_response_pb2_grpc.pyi │ │ ├── service_pb2.py │ │ ├── service_pb2.pyi │ │ ├── service_pb2_grpc.py │ │ └── service_pb2_grpc.pyi ├── bridge │ ├── Cargo.lock │ ├── Cargo.toml │ ├── __init__.py │ ├── client.py │ ├── metric.py │ ├── proto │ │ ├── __init__.py │ │ ├── activity_result │ │ │ ├── __init__.py │ │ │ ├── activity_result_pb2.py │ │ │ └── activity_result_pb2.pyi │ │ ├── activity_task │ │ │ ├── __init__.py │ │ │ ├── activity_task_pb2.py │ │ │ └── activity_task_pb2.pyi │ │ ├── bridge │ │ │ ├── __init__.py │ │ │ ├── bridge_pb2.py │ │ │ └── bridge_pb2.pyi │ │ ├── child_workflow │ │ │ ├── __init__.py │ │ │ ├── child_workflow_pb2.py │ │ │ └── child_workflow_pb2.pyi │ │ ├── common │ │ │ ├── __init__.py │ │ │ ├── common_pb2.py │ │ │ └── common_pb2.pyi │ │ ├── core_interface_pb2.py │ │ ├── core_interface_pb2.pyi │ │ ├── core_interface_pb2_grpc.py │ │ ├── core_interface_pb2_grpc.pyi │ │ ├── external_data │ │ │ ├── __init__.py │ │ │ ├── external_data_pb2.py │ │ │ └── external_data_pb2.pyi │ │ ├── health │ │ │ ├── __init__.py │ │ │ └── v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── health_pb2.py │ │ │ │ └── health_pb2.pyi │ │ ├── nexus │ │ │ ├── __init__.py │ │ │ ├── nexus_pb2.py │ │ │ └── nexus_pb2.pyi │ │ ├── workflow_activation │ │ │ ├── __init__.py │ │ │ ├── workflow_activation_pb2.py │ │ │ └── workflow_activation_pb2.pyi │ │ ├── workflow_commands │ │ │ ├── __init__.py │ │ │ ├── workflow_commands_pb2.py │ │ │ └── workflow_commands_pb2.pyi │ │ └── workflow_completion │ │ │ ├── __init__.py │ │ │ ├── workflow_completion_pb2.py │ │ │ └── workflow_completion_pb2.pyi │ ├── runtime.py │ ├── src │ │ ├── client.rs │ │ ├── envconfig.rs │ │ ├── lib.rs │ │ ├── metric.rs │ │ ├── runtime.rs │ │ ├── testing.rs │ │ └── worker.rs │ ├── testing.py │ └── worker.py ├── client.py ├── common.py ├── contrib │ ├── __init__.py │ ├── openai_agents │ │ ├── README.md │ │ ├── __init__.py │ │ ├── _heartbeat_decorator.py │ │ ├── _openai_runner.py │ │ ├── _temporal_model_stub.py │ │ ├── _temporal_trace_provider.py │ │ ├── invoke_model_activity.py │ │ ├── model_parameters.py │ │ ├── open_ai_data_converter.py │ │ ├── temporal_openai_agents.py │ │ ├── temporal_tools.py │ │ └── trace_interceptor.py │ ├── opentelemetry.py │ └── pydantic.py ├── converter.py ├── envconfig.py ├── exceptions.py ├── py.typed ├── runtime.py ├── service.py ├── testing │ ├── __init__.py │ ├── _activity.py │ └── _workflow.py ├── types.py ├── worker │ ├── __init__.py │ ├── _activity.py │ ├── _interceptor.py │ ├── _replayer.py │ ├── _tuning.py │ ├── _worker.py │ ├── _workflow.py │ ├── _workflow_instance.py │ └── workflow_sandbox │ │ ├── __init__.py │ │ ├── _importer.py │ │ ├── _in_sandbox.py │ │ ├── _restrictions.py │ │ └── _runner.py └── workflow.py ├── tests ├── __init__.py ├── api │ ├── __init__.py │ └── test_grpc_stub.py ├── bridge │ ├── __init__.py │ └── test_runtime.py ├── conftest.py ├── contrib │ ├── __init__.py │ ├── openai_agents │ │ ├── histories │ │ │ ├── agents-as-tools-workflow-history.json │ │ │ ├── customer-service-workflow-history.json │ │ │ ├── hello-workflow-history.json │ │ │ ├── input-guardrail-workflow-history.json │ │ │ ├── output-guardrail-workflow-history.json │ │ │ ├── research-workflow-history.json │ │ │ └── tools-workflow-history.json │ │ ├── research_agents │ │ │ ├── planner_agent.py │ │ │ ├── printer.py │ │ │ ├── research_manager.py │ │ │ ├── search_agent.py │ │ │ └── writer_agent.py │ │ ├── test_openai.py │ │ └── test_openai_replay.py │ ├── pydantic │ │ ├── activities.py │ │ ├── models.py │ │ ├── models_2.py │ │ ├── test_pydantic.py │ │ └── workflows.py │ └── test_opentelemetry.py ├── helpers │ ├── __init__.py │ ├── external_coroutine.py │ ├── external_stack_trace.py │ └── worker.py ├── test_client.py ├── test_common.py ├── test_converter.py ├── test_envconfig.py ├── test_runtime.py ├── test_service.py ├── test_workflow.py ├── testing │ ├── __init__.py │ ├── test_activity.py │ └── test_workflow.py └── worker │ ├── __init__.py │ ├── test_activity.py │ ├── test_interceptor.py │ ├── test_replayer.py │ ├── test_replayer_command_reordering_backward_compatibility.json │ ├── test_replayer_complete_history.json │ ├── test_replayer_event_tracing.json │ ├── test_replayer_event_tracing_alternate.json │ ├── test_replayer_event_tracing_double_sig_at_start.json │ ├── test_replayer_nondeterministic_history.json │ ├── test_replayer_swallowed_activity_cancellation.json │ ├── test_update_with_start.py │ ├── test_worker.py │ ├── test_workflow.py │ └── workflow_sandbox │ ├── __init__.py │ ├── test_importer.py │ ├── test_restrictions.py │ ├── test_runner.py │ └── testmodules │ ├── __init__.py │ ├── invalid_module.py │ ├── invalid_module_members.py │ ├── module_calling_invalid.py │ ├── passthrough_module.py │ ├── proto │ ├── __init__.py │ ├── proto_message.proto │ ├── proto_message_pb2.py │ └── proto_message_pb2.pyi │ └── stateful_module.py └── uv.lock /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # These owners will be the default owners for everything in 2 | # the repo. Unless a later match takes precedence, 3 | # @temporalio/sdk will be requested for review when 4 | # someone opens a pull request. 5 | * @temporalio/sdk 6 | -------------------------------------------------------------------------------- /.github/workflows/build-binaries.yml: -------------------------------------------------------------------------------- 1 | name: Build Binaries 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - "releases/*" 7 | 8 | jobs: 9 | # Compile the binaries and upload artifacts 10 | compile-binaries: 11 | strategy: 12 | fail-fast: false 13 | matrix: 14 | include: 15 | - os: ubuntu-latest 16 | package-suffix: linux-amd64 17 | - os: ubuntu-arm 18 | package-suffix: linux-aarch64 19 | runsOn: ubuntu-24.04-arm64-2-core 20 | - os: macos-intel 21 | package-suffix: macos-amd64 22 | runsOn: macos-13 23 | - os: macos-arm 24 | package-suffix: macos-aarch64 25 | runsOn: macos-14 26 | - os: windows-latest 27 | package-suffix: windows-amd64 28 | runs-on: ${{ matrix.runsOn || matrix.os }} 29 | steps: 30 | - uses: actions/checkout@v4 31 | with: 32 | submodules: recursive 33 | - uses: actions/setup-python@v5 34 | with: 35 | python-version: "3.13" 36 | 37 | # Install Rust locally for non-Linux (Linux uses an internal docker 38 | # command to build with cibuildwheel which uses rustup install defined 39 | # in pyproject.toml) 40 | - if: ${{ runner.os != 'Linux' }} 41 | uses: dtolnay/rust-toolchain@stable 42 | - if: ${{ runner.os != 'Linux' }} 43 | uses: Swatinem/rust-cache@v2 44 | with: 45 | workspaces: temporalio/bridge -> target 46 | - uses: astral-sh/setup-uv@v5 47 | - run: uv sync --all-extras 48 | 49 | # Add the source dist only for Linux x64 for now 50 | - if: ${{ matrix.package-suffix == 'linux-amd64' }} 51 | run: uv build --sdist 52 | 53 | # Build the wheel 54 | - run: uv run cibuildwheel --output-dir dist 55 | 56 | # Install the wheel in a new venv and run a test 57 | - name: Test wheel 58 | shell: bash 59 | run: | 60 | mkdir __test_wheel__ 61 | cd __test_wheel__ 62 | cp -r ../tests . 63 | python -m venv .venv 64 | bindir=bin 65 | if [ "$RUNNER_OS" = "Windows" ]; then 66 | bindir=Scripts 67 | fi 68 | ./.venv/$bindir/pip install 'protobuf>=3.20,<6' 'types-protobuf>=3.20,<6' 'typing-extensions>=4.2.0,<5' pytest pytest_asyncio grpcio pydantic opentelemetry-api opentelemetry-sdk python-dateutil openai-agents 69 | ./.venv/$bindir/pip install --no-index --find-links=../dist temporalio 70 | ./.venv/$bindir/python -m pytest -s -k test_workflow_hello 71 | 72 | # Upload dist 73 | - uses: actions/upload-artifact@v4 74 | with: 75 | name: packages-${{ matrix.package-suffix }} 76 | path: dist 77 | -------------------------------------------------------------------------------- /.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | name: Nightly 2 | 3 | on: 4 | schedule: 5 | # (12 AM PST) 6 | - cron: "00 07 * * *" 7 | 8 | jobs: 9 | nightly: 10 | uses: ./.github/workflows/run-bench.yml 11 | -------------------------------------------------------------------------------- /.github/workflows/omes.yml: -------------------------------------------------------------------------------- 1 | name: Omes Testing 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - "releases/*" 7 | 8 | jobs: 9 | omes-image-build: 10 | uses: temporalio/omes/.github/workflows/docker-images.yml@main 11 | secrets: inherit 12 | with: 13 | lang: python 14 | sdk-repo-url: ${{ github.event.pull_request.head.repo.full_name || 'temporalio/sdk-python' }} 15 | sdk-repo-ref: ${{ github.event.pull_request.head.ref || github.ref }} 16 | # TODO: Remove once we have a good way of cleaning up sha-based pushed images 17 | docker-tag-ext: ci-latest 18 | do-push: true 19 | -------------------------------------------------------------------------------- /.github/workflows/run-bench.yml: -------------------------------------------------------------------------------- 1 | name: Run Bench 2 | on: 3 | workflow_call: 4 | inputs: 5 | sandbox-arg: 6 | description: "Sandbox argument" 7 | required: false 8 | default: "--sandbox" 9 | type: string 10 | workflow_dispatch: 11 | inputs: 12 | sandbox-arg: 13 | description: "Sandbox argument" 14 | required: false 15 | default: "--sandbox" 16 | type: choice 17 | options: 18 | - "--sandbox" 19 | - "--no-sandbox" 20 | 21 | jobs: 22 | run-bench: 23 | strategy: 24 | matrix: 25 | os: [ubuntu-latest-4-cores, windows-latest] 26 | runs-on: ${{ matrix.os }} 27 | steps: 28 | # Prepare 29 | - uses: actions/checkout@v4 30 | with: 31 | submodules: recursive 32 | - uses: dtolnay/rust-toolchain@stable 33 | with: 34 | toolchain: stable 35 | - uses: Swatinem/rust-cache@v2 36 | with: 37 | workspaces: temporalio/bridge -> target 38 | - uses: actions/setup-python@v5 39 | with: 40 | python-version: "3.13" 41 | - uses: arduino/setup-protoc@v3 42 | with: 43 | # TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed 44 | version: "23.x" 45 | repo-token: ${{ secrets.GITHUB_TOKEN }} 46 | 47 | - uses: astral-sh/setup-uv@v5 48 | # Build 49 | - run: uv tool install poethepoet 50 | - run: uv sync --all-extras 51 | - run: poe build-develop-with-release 52 | 53 | # Run a bunch of bench tests. We run multiple times since results vary. 54 | 55 | - run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }} 56 | - run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }} 57 | - run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }} 58 | 59 | - run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }} 60 | - run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }} 61 | - run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }} 62 | 63 | - run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }} 64 | - run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }} 65 | - run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }} 66 | 67 | - run: poe run-bench --workflow-count 10000 --max-cached-workflows 10000 --max-concurrent 10000 ${{ inputs.sandbox-arg }} 68 | - run: poe run-bench --workflow-count 10000 --max-cached-workflows 10000 --max-concurrent 10000 ${{ inputs.sandbox-arg }} 69 | 70 | - run: poe run-bench --workflow-count 10000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }} 71 | - run: poe run-bench --workflow-count 10000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .venv 2 | __pycache__ 3 | /build 4 | /dist 5 | temporalio/bridge/target/ 6 | temporalio/bridge/temporal_sdk_bridge* 7 | /tests/helpers/golangserver/golangserver 8 | /tests/helpers/golangworker/golangworker 9 | /.idea 10 | /sdk-python.iml 11 | /.zed 12 | *.DS_Store 13 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "sdk-core"] 2 | path = temporalio/bridge/sdk-core 3 | url = https://github.com/temporalio/sdk-core.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2022 Temporal Technologies Inc. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /scripts/_img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/scripts/_img/favicon.ico -------------------------------------------------------------------------------- /scripts/_proto/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10 2 | 3 | RUN curl -LsSf https://astral.sh/uv/install.sh | sh 4 | ENV PATH="$PATH:/root/.local/bin" 5 | RUN uv tool install poethepoet 6 | VOLUME ["/api_new", "/bridge_new"] 7 | 8 | COPY ./ ./ 9 | 10 | RUN mkdir -p ./temporalio/api 11 | RUN uv add "protobuf<4" 12 | RUN uv sync --all-extras 13 | RUN poe gen-protos 14 | 15 | CMD cp -r ./temporalio/api/* /api_new && cp -r ./temporalio/bridge/proto/* /bridge_new 16 | -------------------------------------------------------------------------------- /scripts/_proto/Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | .git/ 2 | .idea/ 3 | .mypy_cache/ 4 | .pytest_cache/ 5 | .ruff_cache/ 6 | .venv/ 7 | build/ 8 | dist/ 9 | temporalio/api/ 10 | temporalio/bridge/**/target/ 11 | temporalio/bridge/**/*.so 12 | Dockerfile 13 | .python-version 14 | -------------------------------------------------------------------------------- /scripts/_proto/grpc/health/v1/health.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The gRPC Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // The canonical version of this proto can be found at 16 | // https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto 17 | 18 | syntax = "proto3"; 19 | 20 | // We have to alter this to prevent gRPC health clash 21 | package temporal.grpc.health.v1; 22 | 23 | option csharp_namespace = "Grpc.Health.V1"; 24 | option go_package = "google.golang.org/grpc/health/grpc_health_v1"; 25 | option java_multiple_files = true; 26 | option java_outer_classname = "HealthProto"; 27 | option java_package = "io.grpc.health.v1"; 28 | 29 | message HealthCheckRequest { 30 | string service = 1; 31 | } 32 | 33 | message HealthCheckResponse { 34 | enum ServingStatus { 35 | UNKNOWN = 0; 36 | SERVING = 1; 37 | NOT_SERVING = 2; 38 | SERVICE_UNKNOWN = 3; // Used only by the Watch method. 39 | } 40 | ServingStatus status = 1; 41 | } 42 | 43 | service Health { 44 | // If the requested service is unknown, the call will fail with status 45 | // NOT_FOUND. 46 | rpc Check(HealthCheckRequest) returns (HealthCheckResponse); 47 | 48 | // Performs a watch for the serving status of the requested service. 49 | // The server will immediately send back a message indicating the current 50 | // serving status. It will then subsequently send a new message whenever 51 | // the service's serving status changes. 52 | // 53 | // If the requested service is unknown when the call is received, the 54 | // server will send a message setting the serving status to 55 | // SERVICE_UNKNOWN but will *not* terminate the call. If at some 56 | // future point, the serving status of the service becomes known, the 57 | // server will send a new message with the service's serving status. 58 | // 59 | // If the call terminates with status UNIMPLEMENTED, then clients 60 | // should assume this method is not supported and should not retry the 61 | // call. If the call terminates with any other status (including OK), 62 | // clients should retry the call with appropriate exponential backoff. 63 | rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse); 64 | } 65 | -------------------------------------------------------------------------------- /scripts/_proto/temporal/api/common/v1/grpc_status.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package temporal.api.common.v1; 4 | 5 | import "google/protobuf/any.proto"; 6 | 7 | // From https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto 8 | // since we don't import grpc but still need the status info 9 | message GrpcStatus { 10 | int32 code = 1; 11 | string message = 2; 12 | repeated google.protobuf.Any details = 3; 13 | } 14 | -------------------------------------------------------------------------------- /scripts/gen_docs.py: -------------------------------------------------------------------------------- 1 | import shutil 2 | import subprocess 3 | from pathlib import Path 4 | 5 | base_dir = Path(__file__).parent.parent 6 | 7 | if __name__ == "__main__": 8 | print("Generating documentation...") 9 | 10 | # Run pydoctor 11 | subprocess.check_call("pydoctor") 12 | 13 | # Copy favicon 14 | shutil.copyfile( 15 | base_dir / "scripts" / "_img" / "favicon.ico", 16 | base_dir / "build" / "apidocs" / "favicon.ico", 17 | ) 18 | -------------------------------------------------------------------------------- /temporalio/__init__.py: -------------------------------------------------------------------------------- 1 | """Python SDK for Temporal. 2 | 3 | See the 4 | `Temporal Application Development Guide `_ 5 | and the `GitHub project `_. 6 | 7 | Most users will use :py:mod:`client` for creating a client to Temporal and 8 | :py:mod:`worker` to run workflows and activities. 9 | """ 10 | 11 | from .service import __version__ as __sdk_version 12 | 13 | __version__ = __sdk_version 14 | -------------------------------------------------------------------------------- /temporalio/api/__init__.py: -------------------------------------------------------------------------------- 1 | """Temporal API protobuf models.""" 2 | -------------------------------------------------------------------------------- /temporalio/api/activity/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/activity/__init__.py -------------------------------------------------------------------------------- /temporalio/api/activity/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ActivityOptions 2 | 3 | __all__ = [ 4 | "ActivityOptions", 5 | ] 6 | -------------------------------------------------------------------------------- /temporalio/api/activity/v1/message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/activity/v1/message.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 18 | 19 | from temporalio.api.common.v1 import ( 20 | message_pb2 as temporal_dot_api_dot_common_dot_v1_dot_message__pb2, 21 | ) 22 | from temporalio.api.taskqueue.v1 import ( 23 | message_pb2 as temporal_dot_api_dot_taskqueue_dot_v1_dot_message__pb2, 24 | ) 25 | 26 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 27 | b"\n&temporal/api/activity/v1/message.proto\x12\x18temporal.api.activity.v1\x1a$temporal/api/common/v1/message.proto\x1a'temporal/api/taskqueue/v1/message.proto\x1a\x1egoogle/protobuf/duration.proto\"\xf3\x02\n\x0f\x41\x63tivityOptions\x12\x38\n\ntask_queue\x18\x01 \x01(\x0b\x32$.temporal.api.taskqueue.v1.TaskQueue\x12<\n\x19schedule_to_close_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12<\n\x19schedule_to_start_timeout\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x16start_to_close_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11heartbeat_timeout\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x39\n\x0cretry_policy\x18\x06 \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicyB\x93\x01\n\x1bio.temporal.api.activity.v1B\x0cMessageProtoP\x01Z'go.temporal.io/api/activity/v1;activity\xaa\x02\x1aTemporalio.Api.Activity.V1\xea\x02\x1dTemporalio::Api::Activity::V1b\x06proto3" 28 | ) 29 | 30 | 31 | _ACTIVITYOPTIONS = DESCRIPTOR.message_types_by_name["ActivityOptions"] 32 | ActivityOptions = _reflection.GeneratedProtocolMessageType( 33 | "ActivityOptions", 34 | (_message.Message,), 35 | { 36 | "DESCRIPTOR": _ACTIVITYOPTIONS, 37 | "__module__": "temporal.api.activity.v1.message_pb2", 38 | # @@protoc_insertion_point(class_scope:temporal.api.activity.v1.ActivityOptions) 39 | }, 40 | ) 41 | _sym_db.RegisterMessage(ActivityOptions) 42 | 43 | if _descriptor._USE_C_DESCRIPTORS == False: 44 | DESCRIPTOR._options = None 45 | DESCRIPTOR._serialized_options = b"\n\033io.temporal.api.activity.v1B\014MessageProtoP\001Z'go.temporal.io/api/activity/v1;activity\252\002\032Temporalio.Api.Activity.V1\352\002\035Temporalio::Api::Activity::V1" 46 | _ACTIVITYOPTIONS._serialized_start = 180 47 | _ACTIVITYOPTIONS._serialized_end = 551 48 | # @@protoc_insertion_point(module_scope) 49 | -------------------------------------------------------------------------------- /temporalio/api/batch/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/batch/__init__.py -------------------------------------------------------------------------------- /temporalio/api/batch/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | BatchOperationCancellation, 3 | BatchOperationDeletion, 4 | BatchOperationInfo, 5 | BatchOperationReset, 6 | BatchOperationSignal, 7 | BatchOperationTermination, 8 | BatchOperationTriggerWorkflowRule, 9 | BatchOperationUnpauseActivities, 10 | BatchOperationUpdateWorkflowExecutionOptions, 11 | ) 12 | 13 | __all__ = [ 14 | "BatchOperationCancellation", 15 | "BatchOperationDeletion", 16 | "BatchOperationInfo", 17 | "BatchOperationReset", 18 | "BatchOperationSignal", 19 | "BatchOperationTermination", 20 | "BatchOperationTriggerWorkflowRule", 21 | "BatchOperationUnpauseActivities", 22 | "BatchOperationUpdateWorkflowExecutionOptions", 23 | ] 24 | -------------------------------------------------------------------------------- /temporalio/api/cloud/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/account/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/account/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/account/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import Account, AccountSpec, Metrics, MetricsSpec 2 | 3 | __all__ = [ 4 | "Account", 5 | "AccountSpec", 6 | "Metrics", 7 | "MetricsSpec", 8 | ] 9 | -------------------------------------------------------------------------------- /temporalio/api/cloud/cloudservice/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/cloudservice/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/cloudservice/v1/request_response_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | 4 | import grpc 5 | -------------------------------------------------------------------------------- /temporalio/api/cloud/cloudservice/v1/request_response_pb2_grpc.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | -------------------------------------------------------------------------------- /temporalio/api/cloud/cloudservice/v1/service_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import google.protobuf.descriptor 7 | 8 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 9 | -------------------------------------------------------------------------------- /temporalio/api/cloud/identity/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/identity/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/identity/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | Access, 3 | AccountAccess, 4 | ApiKey, 5 | ApiKeySpec, 6 | CloudGroupSpec, 7 | GoogleGroupSpec, 8 | Invitation, 9 | NamespaceAccess, 10 | NamespaceScopedAccess, 11 | OwnerType, 12 | SCIMGroupSpec, 13 | ServiceAccount, 14 | ServiceAccountSpec, 15 | User, 16 | UserGroup, 17 | UserGroupMember, 18 | UserGroupMemberId, 19 | UserGroupSpec, 20 | UserSpec, 21 | ) 22 | 23 | __all__ = [ 24 | "Access", 25 | "AccountAccess", 26 | "ApiKey", 27 | "ApiKeySpec", 28 | "CloudGroupSpec", 29 | "GoogleGroupSpec", 30 | "Invitation", 31 | "NamespaceAccess", 32 | "NamespaceScopedAccess", 33 | "OwnerType", 34 | "SCIMGroupSpec", 35 | "ServiceAccount", 36 | "ServiceAccountSpec", 37 | "User", 38 | "UserGroup", 39 | "UserGroupMember", 40 | "UserGroupMemberId", 41 | "UserGroupSpec", 42 | "UserSpec", 43 | ] 44 | -------------------------------------------------------------------------------- /temporalio/api/cloud/namespace/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/namespace/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/namespace/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | ApiKeyAuthSpec, 3 | AWSPrivateLinkInfo, 4 | CertificateFilterSpec, 5 | CodecServerSpec, 6 | Endpoints, 7 | ExportSink, 8 | ExportSinkSpec, 9 | HighAvailabilitySpec, 10 | LifecycleSpec, 11 | Limits, 12 | MtlsAuthSpec, 13 | Namespace, 14 | NamespaceRegionStatus, 15 | NamespaceSpec, 16 | PrivateConnectivity, 17 | ) 18 | 19 | __all__ = [ 20 | "AWSPrivateLinkInfo", 21 | "ApiKeyAuthSpec", 22 | "CertificateFilterSpec", 23 | "CodecServerSpec", 24 | "Endpoints", 25 | "ExportSink", 26 | "ExportSinkSpec", 27 | "HighAvailabilitySpec", 28 | "LifecycleSpec", 29 | "Limits", 30 | "MtlsAuthSpec", 31 | "Namespace", 32 | "NamespaceRegionStatus", 33 | "NamespaceSpec", 34 | "PrivateConnectivity", 35 | ] 36 | -------------------------------------------------------------------------------- /temporalio/api/cloud/nexus/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/nexus/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/nexus/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | AllowedCloudNamespacePolicySpec, 3 | Endpoint, 4 | EndpointPolicySpec, 5 | EndpointSpec, 6 | EndpointTargetSpec, 7 | WorkerTargetSpec, 8 | ) 9 | 10 | __all__ = [ 11 | "AllowedCloudNamespacePolicySpec", 12 | "Endpoint", 13 | "EndpointPolicySpec", 14 | "EndpointSpec", 15 | "EndpointTargetSpec", 16 | "WorkerTargetSpec", 17 | ] 18 | -------------------------------------------------------------------------------- /temporalio/api/cloud/operation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/operation/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/operation/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import AsyncOperation 2 | 3 | __all__ = [ 4 | "AsyncOperation", 5 | ] 6 | -------------------------------------------------------------------------------- /temporalio/api/cloud/operation/v1/message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/cloud/operation/v1/message.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 18 | from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 19 | from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 20 | 21 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 22 | b'\n-temporal/api/cloud/operation/v1/message.proto\x12\x1ftemporal.api.cloud.operation.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19google/protobuf/any.proto"\xfe\x03\n\x0e\x41syncOperation\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1c\n\x10state_deprecated\x18\x02 \x01(\tB\x02\x18\x01\x12\x44\n\x05state\x18\t \x01(\x0e\x32\x35.temporal.api.cloud.operation.v1.AsyncOperation.State\x12\x31\n\x0e\x63heck_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x16\n\x0eoperation_type\x18\x04 \x01(\t\x12-\n\x0foperation_input\x18\x05 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x16\n\x0e\x66\x61ilure_reason\x18\x06 \x01(\t\x12\x30\n\x0cstarted_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rfinished_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\x84\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rSTATE_PENDING\x10\x01\x12\x15\n\x11STATE_IN_PROGRESS\x10\x02\x12\x10\n\x0cSTATE_FAILED\x10\x03\x12\x13\n\x0fSTATE_CANCELLED\x10\x04\x12\x13\n\x0fSTATE_FULFILLED\x10\x05\x42\xb1\x01\n"io.temporal.api.cloud.operation.v1B\x0cMessageProtoP\x01Z/go.temporal.io/api/cloud/operation/v1;operation\xaa\x02!Temporalio.Api.Cloud.Operation.V1\xea\x02%Temporalio::Api::Cloud::Operation::V1b\x06proto3' 23 | ) 24 | 25 | 26 | _ASYNCOPERATION = DESCRIPTOR.message_types_by_name["AsyncOperation"] 27 | _ASYNCOPERATION_STATE = _ASYNCOPERATION.enum_types_by_name["State"] 28 | AsyncOperation = _reflection.GeneratedProtocolMessageType( 29 | "AsyncOperation", 30 | (_message.Message,), 31 | { 32 | "DESCRIPTOR": _ASYNCOPERATION, 33 | "__module__": "temporal.api.cloud.operation.v1.message_pb2", 34 | # @@protoc_insertion_point(class_scope:temporal.api.cloud.operation.v1.AsyncOperation) 35 | }, 36 | ) 37 | _sym_db.RegisterMessage(AsyncOperation) 38 | 39 | if _descriptor._USE_C_DESCRIPTORS == False: 40 | DESCRIPTOR._options = None 41 | DESCRIPTOR._serialized_options = b'\n"io.temporal.api.cloud.operation.v1B\014MessageProtoP\001Z/go.temporal.io/api/cloud/operation/v1;operation\252\002!Temporalio.Api.Cloud.Operation.V1\352\002%Temporalio::Api::Cloud::Operation::V1' 42 | _ASYNCOPERATION.fields_by_name["state_deprecated"]._options = None 43 | _ASYNCOPERATION.fields_by_name["state_deprecated"]._serialized_options = b"\030\001" 44 | _ASYNCOPERATION._serialized_start = 175 45 | _ASYNCOPERATION._serialized_end = 685 46 | _ASYNCOPERATION_STATE._serialized_start = 553 47 | _ASYNCOPERATION_STATE._serialized_end = 685 48 | # @@protoc_insertion_point(module_scope) 49 | -------------------------------------------------------------------------------- /temporalio/api/cloud/region/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/region/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/region/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import Region 2 | 3 | __all__ = [ 4 | "Region", 5 | ] 6 | -------------------------------------------------------------------------------- /temporalio/api/cloud/region/v1/message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/cloud/region/v1/message.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 18 | b'\n*temporal/api/cloud/region/v1/message.proto\x12\x1ctemporal.api.cloud.region.v1"\x99\x02\n\x06Region\x12\n\n\x02id\x18\x01 \x01(\t\x12%\n\x19\x63loud_provider_deprecated\x18\x02 \x01(\tB\x02\x18\x01\x12J\n\x0e\x63loud_provider\x18\x05 \x01(\x0e\x32\x32.temporal.api.cloud.region.v1.Region.CloudProvider\x12\x1d\n\x15\x63loud_provider_region\x18\x03 \x01(\t\x12\x10\n\x08location\x18\x04 \x01(\t"_\n\rCloudProvider\x12\x1e\n\x1a\x43LOUD_PROVIDER_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43LOUD_PROVIDER_AWS\x10\x01\x12\x16\n\x12\x43LOUD_PROVIDER_GCP\x10\x02\x42\xa2\x01\n\x1fio.temporal.api.cloud.region.v1B\x0cMessageProtoP\x01Z)go.temporal.io/api/cloud/region/v1;region\xaa\x02\x1eTemporalio.Api.Cloud.Region.V1\xea\x02"Temporalio::Api::Cloud::Region::V1b\x06proto3' 19 | ) 20 | 21 | 22 | _REGION = DESCRIPTOR.message_types_by_name["Region"] 23 | _REGION_CLOUDPROVIDER = _REGION.enum_types_by_name["CloudProvider"] 24 | Region = _reflection.GeneratedProtocolMessageType( 25 | "Region", 26 | (_message.Message,), 27 | { 28 | "DESCRIPTOR": _REGION, 29 | "__module__": "temporal.api.cloud.region.v1.message_pb2", 30 | # @@protoc_insertion_point(class_scope:temporal.api.cloud.region.v1.Region) 31 | }, 32 | ) 33 | _sym_db.RegisterMessage(Region) 34 | 35 | if _descriptor._USE_C_DESCRIPTORS == False: 36 | DESCRIPTOR._options = None 37 | DESCRIPTOR._serialized_options = b'\n\037io.temporal.api.cloud.region.v1B\014MessageProtoP\001Z)go.temporal.io/api/cloud/region/v1;region\252\002\036Temporalio.Api.Cloud.Region.V1\352\002"Temporalio::Api::Cloud::Region::V1' 38 | _REGION.fields_by_name["cloud_provider_deprecated"]._options = None 39 | _REGION.fields_by_name[ 40 | "cloud_provider_deprecated" 41 | ]._serialized_options = b"\030\001" 42 | _REGION._serialized_start = 77 43 | _REGION._serialized_end = 358 44 | _REGION_CLOUDPROVIDER._serialized_start = 263 45 | _REGION_CLOUDPROVIDER._serialized_end = 358 46 | # @@protoc_insertion_point(module_scope) 47 | -------------------------------------------------------------------------------- /temporalio/api/cloud/region/v1/message_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | import typing 9 | 10 | import google.protobuf.descriptor 11 | import google.protobuf.internal.enum_type_wrapper 12 | import google.protobuf.message 13 | 14 | if sys.version_info >= (3, 10): 15 | import typing as typing_extensions 16 | else: 17 | import typing_extensions 18 | 19 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 20 | 21 | class Region(google.protobuf.message.Message): 22 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 23 | 24 | class _CloudProvider: 25 | ValueType = typing.NewType("ValueType", builtins.int) 26 | V: typing_extensions.TypeAlias = ValueType 27 | 28 | class _CloudProviderEnumTypeWrapper( 29 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 30 | Region._CloudProvider.ValueType 31 | ], 32 | builtins.type, 33 | ): # noqa: F821 34 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 35 | CLOUD_PROVIDER_UNSPECIFIED: Region._CloudProvider.ValueType # 0 36 | CLOUD_PROVIDER_AWS: Region._CloudProvider.ValueType # 1 37 | CLOUD_PROVIDER_GCP: Region._CloudProvider.ValueType # 2 38 | 39 | class CloudProvider(_CloudProvider, metaclass=_CloudProviderEnumTypeWrapper): 40 | """The cloud provider that's hosting the region.""" 41 | 42 | CLOUD_PROVIDER_UNSPECIFIED: Region.CloudProvider.ValueType # 0 43 | CLOUD_PROVIDER_AWS: Region.CloudProvider.ValueType # 1 44 | CLOUD_PROVIDER_GCP: Region.CloudProvider.ValueType # 2 45 | 46 | ID_FIELD_NUMBER: builtins.int 47 | CLOUD_PROVIDER_DEPRECATED_FIELD_NUMBER: builtins.int 48 | CLOUD_PROVIDER_FIELD_NUMBER: builtins.int 49 | CLOUD_PROVIDER_REGION_FIELD_NUMBER: builtins.int 50 | LOCATION_FIELD_NUMBER: builtins.int 51 | id: builtins.str 52 | """The id of the temporal cloud region.""" 53 | cloud_provider_deprecated: builtins.str 54 | """The name of the cloud provider that's hosting the region. 55 | Currently only "aws" is supported. 56 | Deprecated: Not supported after v0.3.0 api version. Use cloud_provider instead. 57 | temporal:versioning:max_version=v0.3.0 58 | """ 59 | cloud_provider: global___Region.CloudProvider.ValueType 60 | """The cloud provider that's hosting the region. 61 | temporal:versioning:min_version=v0.3.0 62 | temporal:enums:replaces=cloud_provider_deprecated 63 | """ 64 | cloud_provider_region: builtins.str 65 | """The region identifier as defined by the cloud provider.""" 66 | location: builtins.str 67 | """The human readable location of the region.""" 68 | def __init__( 69 | self, 70 | *, 71 | id: builtins.str = ..., 72 | cloud_provider_deprecated: builtins.str = ..., 73 | cloud_provider: global___Region.CloudProvider.ValueType = ..., 74 | cloud_provider_region: builtins.str = ..., 75 | location: builtins.str = ..., 76 | ) -> None: ... 77 | def ClearField( 78 | self, 79 | field_name: typing_extensions.Literal[ 80 | "cloud_provider", 81 | b"cloud_provider", 82 | "cloud_provider_deprecated", 83 | b"cloud_provider_deprecated", 84 | "cloud_provider_region", 85 | b"cloud_provider_region", 86 | "id", 87 | b"id", 88 | "location", 89 | b"location", 90 | ], 91 | ) -> None: ... 92 | 93 | global___Region = Region 94 | -------------------------------------------------------------------------------- /temporalio/api/cloud/resource/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/resource/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/resource/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ResourceState 2 | 3 | __all__ = [ 4 | "ResourceState", 5 | ] 6 | -------------------------------------------------------------------------------- /temporalio/api/cloud/resource/v1/message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/cloud/resource/v1/message.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b"\n,temporal/api/cloud/resource/v1/message.proto\x12\x1etemporal.api.cloud.resource.v1*\xe3\x02\n\rResourceState\x12\x1e\n\x1aRESOURCE_STATE_UNSPECIFIED\x10\x00\x12\x1d\n\x19RESOURCE_STATE_ACTIVATING\x10\x01\x12$\n RESOURCE_STATE_ACTIVATION_FAILED\x10\x02\x12\x19\n\x15RESOURCE_STATE_ACTIVE\x10\x03\x12\x1b\n\x17RESOURCE_STATE_UPDATING\x10\x04\x12 \n\x1cRESOURCE_STATE_UPDATE_FAILED\x10\x05\x12\x1b\n\x17RESOURCE_STATE_DELETING\x10\x06\x12 \n\x1cRESOURCE_STATE_DELETE_FAILED\x10\x07\x12\x1a\n\x16RESOURCE_STATE_DELETED\x10\x08\x12\x1c\n\x18RESOURCE_STATE_SUSPENDED\x10\t\x12\x1a\n\x16RESOURCE_STATE_EXPIRED\x10\nB\xac\x01\n!io.temporal.api.cloud.resource.v1B\x0cMessageProtoP\x01Z-go.temporal.io/api/cloud/resource/v1;resource\xaa\x02 Temporalio.Api.Cloud.Resource.V1\xea\x02$Temporalio::Api::Cloud::Resource::V1b\x06proto3" 20 | ) 21 | 22 | _RESOURCESTATE = DESCRIPTOR.enum_types_by_name["ResourceState"] 23 | ResourceState = enum_type_wrapper.EnumTypeWrapper(_RESOURCESTATE) 24 | RESOURCE_STATE_UNSPECIFIED = 0 25 | RESOURCE_STATE_ACTIVATING = 1 26 | RESOURCE_STATE_ACTIVATION_FAILED = 2 27 | RESOURCE_STATE_ACTIVE = 3 28 | RESOURCE_STATE_UPDATING = 4 29 | RESOURCE_STATE_UPDATE_FAILED = 5 30 | RESOURCE_STATE_DELETING = 6 31 | RESOURCE_STATE_DELETE_FAILED = 7 32 | RESOURCE_STATE_DELETED = 8 33 | RESOURCE_STATE_SUSPENDED = 9 34 | RESOURCE_STATE_EXPIRED = 10 35 | 36 | 37 | if _descriptor._USE_C_DESCRIPTORS == False: 38 | DESCRIPTOR._options = None 39 | DESCRIPTOR._serialized_options = b"\n!io.temporal.api.cloud.resource.v1B\014MessageProtoP\001Z-go.temporal.io/api/cloud/resource/v1;resource\252\002 Temporalio.Api.Cloud.Resource.V1\352\002$Temporalio::Api::Cloud::Resource::V1" 40 | _RESOURCESTATE._serialized_start = 81 41 | _RESOURCESTATE._serialized_end = 436 42 | # @@protoc_insertion_point(module_scope) 43 | -------------------------------------------------------------------------------- /temporalio/api/cloud/sink/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/sink/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/sink/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import GCSSpec, S3Spec 2 | 3 | __all__ = [ 4 | "GCSSpec", 5 | "S3Spec", 6 | ] 7 | -------------------------------------------------------------------------------- /temporalio/api/cloud/sink/v1/message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/cloud/sink/v1/message.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 18 | b'\n(temporal/api/cloud/sink/v1/message.proto\x12\x1atemporal.api.cloud.sink.v1"i\n\x06S3Spec\x12\x11\n\trole_name\x18\x01 \x01(\t\x12\x13\n\x0b\x62ucket_name\x18\x02 \x01(\t\x12\x0e\n\x06region\x18\x03 \x01(\t\x12\x0f\n\x07kms_arn\x18\x04 \x01(\t\x12\x16\n\x0e\x61ws_account_id\x18\x05 \x01(\t"U\n\x07GCSSpec\x12\r\n\x05sa_id\x18\x01 \x01(\t\x12\x13\n\x0b\x62ucket_name\x18\x02 \x01(\t\x12\x16\n\x0egcp_project_id\x18\x03 \x01(\t\x12\x0e\n\x06region\x18\x04 \x01(\tB\x98\x01\n\x1dio.temporal.api.cloud.sink.v1B\x0cMessageProtoP\x01Z%go.temporal.io/api/cloud/sink/v1;sink\xaa\x02\x1cTemporalio.Api.Cloud.Sink.V1\xea\x02 Temporalio::Api::Cloud::Sink::V1b\x06proto3' 19 | ) 20 | 21 | 22 | _S3SPEC = DESCRIPTOR.message_types_by_name["S3Spec"] 23 | _GCSSPEC = DESCRIPTOR.message_types_by_name["GCSSpec"] 24 | S3Spec = _reflection.GeneratedProtocolMessageType( 25 | "S3Spec", 26 | (_message.Message,), 27 | { 28 | "DESCRIPTOR": _S3SPEC, 29 | "__module__": "temporal.api.cloud.sink.v1.message_pb2", 30 | # @@protoc_insertion_point(class_scope:temporal.api.cloud.sink.v1.S3Spec) 31 | }, 32 | ) 33 | _sym_db.RegisterMessage(S3Spec) 34 | 35 | GCSSpec = _reflection.GeneratedProtocolMessageType( 36 | "GCSSpec", 37 | (_message.Message,), 38 | { 39 | "DESCRIPTOR": _GCSSPEC, 40 | "__module__": "temporal.api.cloud.sink.v1.message_pb2", 41 | # @@protoc_insertion_point(class_scope:temporal.api.cloud.sink.v1.GCSSpec) 42 | }, 43 | ) 44 | _sym_db.RegisterMessage(GCSSpec) 45 | 46 | if _descriptor._USE_C_DESCRIPTORS == False: 47 | DESCRIPTOR._options = None 48 | DESCRIPTOR._serialized_options = b"\n\035io.temporal.api.cloud.sink.v1B\014MessageProtoP\001Z%go.temporal.io/api/cloud/sink/v1;sink\252\002\034Temporalio.Api.Cloud.Sink.V1\352\002 Temporalio::Api::Cloud::Sink::V1" 49 | _S3SPEC._serialized_start = 72 50 | _S3SPEC._serialized_end = 177 51 | _GCSSPEC._serialized_start = 179 52 | _GCSSPEC._serialized_end = 264 53 | # @@protoc_insertion_point(module_scope) 54 | -------------------------------------------------------------------------------- /temporalio/api/cloud/sink/v1/message_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | 9 | import google.protobuf.descriptor 10 | import google.protobuf.message 11 | 12 | if sys.version_info >= (3, 8): 13 | import typing as typing_extensions 14 | else: 15 | import typing_extensions 16 | 17 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 18 | 19 | class S3Spec(google.protobuf.message.Message): 20 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 21 | 22 | ROLE_NAME_FIELD_NUMBER: builtins.int 23 | BUCKET_NAME_FIELD_NUMBER: builtins.int 24 | REGION_FIELD_NUMBER: builtins.int 25 | KMS_ARN_FIELD_NUMBER: builtins.int 26 | AWS_ACCOUNT_ID_FIELD_NUMBER: builtins.int 27 | role_name: builtins.str 28 | """The IAM role that Temporal Cloud assumes for writing records to the customer's S3 bucket.""" 29 | bucket_name: builtins.str 30 | """The name of the destination S3 bucket where Temporal will send data.""" 31 | region: builtins.str 32 | """The region where the S3 bucket is located.""" 33 | kms_arn: builtins.str 34 | """The AWS Key Management Service (KMS) ARN used for encryption.""" 35 | aws_account_id: builtins.str 36 | """The AWS account ID associated with the S3 bucket and the assumed role.""" 37 | def __init__( 38 | self, 39 | *, 40 | role_name: builtins.str = ..., 41 | bucket_name: builtins.str = ..., 42 | region: builtins.str = ..., 43 | kms_arn: builtins.str = ..., 44 | aws_account_id: builtins.str = ..., 45 | ) -> None: ... 46 | def ClearField( 47 | self, 48 | field_name: typing_extensions.Literal[ 49 | "aws_account_id", 50 | b"aws_account_id", 51 | "bucket_name", 52 | b"bucket_name", 53 | "kms_arn", 54 | b"kms_arn", 55 | "region", 56 | b"region", 57 | "role_name", 58 | b"role_name", 59 | ], 60 | ) -> None: ... 61 | 62 | global___S3Spec = S3Spec 63 | 64 | class GCSSpec(google.protobuf.message.Message): 65 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 66 | 67 | SA_ID_FIELD_NUMBER: builtins.int 68 | BUCKET_NAME_FIELD_NUMBER: builtins.int 69 | GCP_PROJECT_ID_FIELD_NUMBER: builtins.int 70 | REGION_FIELD_NUMBER: builtins.int 71 | sa_id: builtins.str 72 | """The customer service account ID that Temporal Cloud impersonates for writing records to the customer's GCS bucket.""" 73 | bucket_name: builtins.str 74 | """The name of the destination GCS bucket where Temporal will send data.""" 75 | gcp_project_id: builtins.str 76 | """The GCP project ID associated with the GCS bucket and service account.""" 77 | region: builtins.str 78 | """The region of the gcs bucket""" 79 | def __init__( 80 | self, 81 | *, 82 | sa_id: builtins.str = ..., 83 | bucket_name: builtins.str = ..., 84 | gcp_project_id: builtins.str = ..., 85 | region: builtins.str = ..., 86 | ) -> None: ... 87 | def ClearField( 88 | self, 89 | field_name: typing_extensions.Literal[ 90 | "bucket_name", 91 | b"bucket_name", 92 | "gcp_project_id", 93 | b"gcp_project_id", 94 | "region", 95 | b"region", 96 | "sa_id", 97 | b"sa_id", 98 | ], 99 | ) -> None: ... 100 | 101 | global___GCSSpec = GCSSpec 102 | -------------------------------------------------------------------------------- /temporalio/api/cloud/usage/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cloud/usage/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cloud/usage/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | GroupBy, 3 | GroupByKey, 4 | Record, 5 | RecordGroup, 6 | RecordType, 7 | RecordUnit, 8 | Summary, 9 | ) 10 | 11 | __all__ = [ 12 | "GroupBy", 13 | "GroupByKey", 14 | "Record", 15 | "RecordGroup", 16 | "RecordType", 17 | "RecordUnit", 18 | "Summary", 19 | ] 20 | -------------------------------------------------------------------------------- /temporalio/api/cluster/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/cluster/__init__.py -------------------------------------------------------------------------------- /temporalio/api/cluster/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | ClusterMember, 3 | ClusterMetadata, 4 | HostInfo, 5 | IndexSearchAttributes, 6 | MembershipInfo, 7 | RingInfo, 8 | ) 9 | 10 | __all__ = [ 11 | "ClusterMember", 12 | "ClusterMetadata", 13 | "HostInfo", 14 | "IndexSearchAttributes", 15 | "MembershipInfo", 16 | "RingInfo", 17 | ] 18 | -------------------------------------------------------------------------------- /temporalio/api/cluster/v1/message_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | 4 | import grpc 5 | -------------------------------------------------------------------------------- /temporalio/api/cluster/v1/message_pb2_grpc.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | The MIT License 5 | 6 | Copyright (c) 2022 Temporal Technologies Inc. All rights reserved. 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | """ 26 | -------------------------------------------------------------------------------- /temporalio/api/command/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/command/__init__.py -------------------------------------------------------------------------------- /temporalio/api/command/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | CancelTimerCommandAttributes, 3 | CancelWorkflowExecutionCommandAttributes, 4 | Command, 5 | CompleteWorkflowExecutionCommandAttributes, 6 | ContinueAsNewWorkflowExecutionCommandAttributes, 7 | FailWorkflowExecutionCommandAttributes, 8 | ModifyWorkflowPropertiesCommandAttributes, 9 | ProtocolMessageCommandAttributes, 10 | RecordMarkerCommandAttributes, 11 | RequestCancelActivityTaskCommandAttributes, 12 | RequestCancelExternalWorkflowExecutionCommandAttributes, 13 | RequestCancelNexusOperationCommandAttributes, 14 | ScheduleActivityTaskCommandAttributes, 15 | ScheduleNexusOperationCommandAttributes, 16 | SignalExternalWorkflowExecutionCommandAttributes, 17 | StartChildWorkflowExecutionCommandAttributes, 18 | StartTimerCommandAttributes, 19 | UpsertWorkflowSearchAttributesCommandAttributes, 20 | ) 21 | 22 | __all__ = [ 23 | "CancelTimerCommandAttributes", 24 | "CancelWorkflowExecutionCommandAttributes", 25 | "Command", 26 | "CompleteWorkflowExecutionCommandAttributes", 27 | "ContinueAsNewWorkflowExecutionCommandAttributes", 28 | "FailWorkflowExecutionCommandAttributes", 29 | "ModifyWorkflowPropertiesCommandAttributes", 30 | "ProtocolMessageCommandAttributes", 31 | "RecordMarkerCommandAttributes", 32 | "RequestCancelActivityTaskCommandAttributes", 33 | "RequestCancelExternalWorkflowExecutionCommandAttributes", 34 | "RequestCancelNexusOperationCommandAttributes", 35 | "ScheduleActivityTaskCommandAttributes", 36 | "ScheduleNexusOperationCommandAttributes", 37 | "SignalExternalWorkflowExecutionCommandAttributes", 38 | "StartChildWorkflowExecutionCommandAttributes", 39 | "StartTimerCommandAttributes", 40 | "UpsertWorkflowSearchAttributesCommandAttributes", 41 | ] 42 | -------------------------------------------------------------------------------- /temporalio/api/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/common/__init__.py -------------------------------------------------------------------------------- /temporalio/api/common/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .grpc_status_pb2 import GrpcStatus 2 | from .message_pb2 import ( 3 | ActivityType, 4 | Callback, 5 | DataBlob, 6 | Header, 7 | Link, 8 | Memo, 9 | MeteringMetadata, 10 | Payload, 11 | Payloads, 12 | Priority, 13 | ResetOptions, 14 | RetryPolicy, 15 | SearchAttributes, 16 | WorkerVersionCapabilities, 17 | WorkerVersionStamp, 18 | WorkflowExecution, 19 | WorkflowType, 20 | ) 21 | 22 | __all__ = [ 23 | "ActivityType", 24 | "Callback", 25 | "DataBlob", 26 | "GrpcStatus", 27 | "Header", 28 | "Link", 29 | "Memo", 30 | "MeteringMetadata", 31 | "Payload", 32 | "Payloads", 33 | "Priority", 34 | "ResetOptions", 35 | "RetryPolicy", 36 | "SearchAttributes", 37 | "WorkerVersionCapabilities", 38 | "WorkerVersionStamp", 39 | "WorkflowExecution", 40 | "WorkflowType", 41 | ] 42 | -------------------------------------------------------------------------------- /temporalio/api/common/v1/grpc_status_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/common/v1/grpc_status.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 18 | 19 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 20 | b'\n(temporal/api/common/v1/grpc_status.proto\x12\x16temporal.api.common.v1\x1a\x19google/protobuf/any.proto"R\n\nGrpcStatus\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\x12%\n\x07\x64\x65tails\x18\x03 \x03(\x0b\x32\x14.google.protobuf.Anyb\x06proto3' 21 | ) 22 | 23 | 24 | _GRPCSTATUS = DESCRIPTOR.message_types_by_name["GrpcStatus"] 25 | GrpcStatus = _reflection.GeneratedProtocolMessageType( 26 | "GrpcStatus", 27 | (_message.Message,), 28 | { 29 | "DESCRIPTOR": _GRPCSTATUS, 30 | "__module__": "temporal.api.common.v1.grpc_status_pb2", 31 | # @@protoc_insertion_point(class_scope:temporal.api.common.v1.GrpcStatus) 32 | }, 33 | ) 34 | _sym_db.RegisterMessage(GrpcStatus) 35 | 36 | if _descriptor._USE_C_DESCRIPTORS == False: 37 | DESCRIPTOR._options = None 38 | _GRPCSTATUS._serialized_start = 95 39 | _GRPCSTATUS._serialized_end = 177 40 | # @@protoc_insertion_point(module_scope) 41 | -------------------------------------------------------------------------------- /temporalio/api/common/v1/grpc_status_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import collections.abc 8 | import sys 9 | 10 | import google.protobuf.any_pb2 11 | import google.protobuf.descriptor 12 | import google.protobuf.internal.containers 13 | import google.protobuf.message 14 | 15 | if sys.version_info >= (3, 8): 16 | import typing as typing_extensions 17 | else: 18 | import typing_extensions 19 | 20 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 21 | 22 | class GrpcStatus(google.protobuf.message.Message): 23 | """From https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto 24 | since we don't import grpc but still need the status info 25 | """ 26 | 27 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 28 | 29 | CODE_FIELD_NUMBER: builtins.int 30 | MESSAGE_FIELD_NUMBER: builtins.int 31 | DETAILS_FIELD_NUMBER: builtins.int 32 | code: builtins.int 33 | message: builtins.str 34 | @property 35 | def details( 36 | self, 37 | ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ 38 | google.protobuf.any_pb2.Any 39 | ]: ... 40 | def __init__( 41 | self, 42 | *, 43 | code: builtins.int = ..., 44 | message: builtins.str = ..., 45 | details: collections.abc.Iterable[google.protobuf.any_pb2.Any] | None = ..., 46 | ) -> None: ... 47 | def ClearField( 48 | self, 49 | field_name: typing_extensions.Literal[ 50 | "code", b"code", "details", b"details", "message", b"message" 51 | ], 52 | ) -> None: ... 53 | 54 | global___GrpcStatus = GrpcStatus 55 | -------------------------------------------------------------------------------- /temporalio/api/deployment/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/deployment/__init__.py -------------------------------------------------------------------------------- /temporalio/api/deployment/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | Deployment, 3 | DeploymentInfo, 4 | DeploymentListInfo, 5 | RoutingConfig, 6 | UpdateDeploymentMetadata, 7 | VersionDrainageInfo, 8 | VersionMetadata, 9 | WorkerDeploymentInfo, 10 | WorkerDeploymentOptions, 11 | WorkerDeploymentVersion, 12 | WorkerDeploymentVersionInfo, 13 | ) 14 | 15 | __all__ = [ 16 | "Deployment", 17 | "DeploymentInfo", 18 | "DeploymentListInfo", 19 | "RoutingConfig", 20 | "UpdateDeploymentMetadata", 21 | "VersionDrainageInfo", 22 | "VersionMetadata", 23 | "WorkerDeploymentInfo", 24 | "WorkerDeploymentOptions", 25 | "WorkerDeploymentVersion", 26 | "WorkerDeploymentVersionInfo", 27 | ] 28 | -------------------------------------------------------------------------------- /temporalio/api/enums/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/enums/__init__.py -------------------------------------------------------------------------------- /temporalio/api/enums/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .batch_operation_pb2 import BatchOperationState, BatchOperationType 2 | from .command_type_pb2 import CommandType 3 | from .common_pb2 import ( 4 | ApplicationErrorCategory, 5 | CallbackState, 6 | EncodingType, 7 | IndexedValueType, 8 | NexusOperationCancellationState, 9 | PendingNexusOperationState, 10 | Severity, 11 | WorkflowRuleActionScope, 12 | ) 13 | from .deployment_pb2 import ( 14 | DeploymentReachability, 15 | VersionDrainageStatus, 16 | WorkerVersioningMode, 17 | ) 18 | from .event_type_pb2 import EventType 19 | from .failed_cause_pb2 import ( 20 | CancelExternalWorkflowExecutionFailedCause, 21 | ResourceExhaustedCause, 22 | ResourceExhaustedScope, 23 | SignalExternalWorkflowExecutionFailedCause, 24 | StartChildWorkflowExecutionFailedCause, 25 | WorkflowTaskFailedCause, 26 | ) 27 | from .namespace_pb2 import ArchivalState, NamespaceState, ReplicationState 28 | from .nexus_pb2 import NexusHandlerErrorRetryBehavior 29 | from .query_pb2 import QueryRejectCondition, QueryResultType 30 | from .reset_pb2 import ResetReapplyExcludeType, ResetReapplyType, ResetType 31 | from .schedule_pb2 import ScheduleOverlapPolicy 32 | from .task_queue_pb2 import ( 33 | BuildIdTaskReachability, 34 | DescribeTaskQueueMode, 35 | TaskQueueKind, 36 | TaskQueueType, 37 | TaskReachability, 38 | ) 39 | from .update_pb2 import UpdateAdmittedEventOrigin, UpdateWorkflowExecutionLifecycleStage 40 | from .workflow_pb2 import ( 41 | ContinueAsNewInitiator, 42 | HistoryEventFilterType, 43 | ParentClosePolicy, 44 | PendingActivityState, 45 | PendingWorkflowTaskState, 46 | RetryState, 47 | TimeoutType, 48 | VersioningBehavior, 49 | WorkflowExecutionStatus, 50 | WorkflowIdConflictPolicy, 51 | WorkflowIdReusePolicy, 52 | ) 53 | 54 | __all__ = [ 55 | "ApplicationErrorCategory", 56 | "ArchivalState", 57 | "BatchOperationState", 58 | "BatchOperationType", 59 | "BuildIdTaskReachability", 60 | "CallbackState", 61 | "CancelExternalWorkflowExecutionFailedCause", 62 | "CommandType", 63 | "ContinueAsNewInitiator", 64 | "DeploymentReachability", 65 | "DescribeTaskQueueMode", 66 | "EncodingType", 67 | "EventType", 68 | "HistoryEventFilterType", 69 | "IndexedValueType", 70 | "NamespaceState", 71 | "NexusHandlerErrorRetryBehavior", 72 | "NexusOperationCancellationState", 73 | "ParentClosePolicy", 74 | "PendingActivityState", 75 | "PendingNexusOperationState", 76 | "PendingWorkflowTaskState", 77 | "QueryRejectCondition", 78 | "QueryResultType", 79 | "ReplicationState", 80 | "ResetReapplyExcludeType", 81 | "ResetReapplyType", 82 | "ResetType", 83 | "ResourceExhaustedCause", 84 | "ResourceExhaustedScope", 85 | "RetryState", 86 | "ScheduleOverlapPolicy", 87 | "Severity", 88 | "SignalExternalWorkflowExecutionFailedCause", 89 | "StartChildWorkflowExecutionFailedCause", 90 | "TaskQueueKind", 91 | "TaskQueueType", 92 | "TaskReachability", 93 | "TimeoutType", 94 | "UpdateAdmittedEventOrigin", 95 | "UpdateWorkflowExecutionLifecycleStage", 96 | "VersionDrainageStatus", 97 | "VersioningBehavior", 98 | "WorkerVersioningMode", 99 | "WorkflowExecutionStatus", 100 | "WorkflowIdConflictPolicy", 101 | "WorkflowIdReusePolicy", 102 | "WorkflowRuleActionScope", 103 | "WorkflowTaskFailedCause", 104 | ] 105 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/batch_operation_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/batch_operation.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b'\n+temporal/api/enums/v1/batch_operation.proto\x12\x15temporal.api.enums.v1*\x94\x02\n\x12\x42\x61tchOperationType\x12$\n BATCH_OPERATION_TYPE_UNSPECIFIED\x10\x00\x12"\n\x1e\x42\x41TCH_OPERATION_TYPE_TERMINATE\x10\x01\x12\x1f\n\x1b\x42\x41TCH_OPERATION_TYPE_CANCEL\x10\x02\x12\x1f\n\x1b\x42\x41TCH_OPERATION_TYPE_SIGNAL\x10\x03\x12\x1f\n\x1b\x42\x41TCH_OPERATION_TYPE_DELETE\x10\x04\x12\x1e\n\x1a\x42\x41TCH_OPERATION_TYPE_RESET\x10\x05\x12\x31\n-BATCH_OPERATION_TYPE_UPDATE_EXECUTION_OPTIONS\x10\x06*\xa6\x01\n\x13\x42\x61tchOperationState\x12%\n!BATCH_OPERATION_STATE_UNSPECIFIED\x10\x00\x12!\n\x1d\x42\x41TCH_OPERATION_STATE_RUNNING\x10\x01\x12#\n\x1f\x42\x41TCH_OPERATION_STATE_COMPLETED\x10\x02\x12 \n\x1c\x42\x41TCH_OPERATION_STATE_FAILED\x10\x03\x42\x8b\x01\n\x18io.temporal.api.enums.v1B\x13\x42\x61tchOperationProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3' 20 | ) 21 | 22 | _BATCHOPERATIONTYPE = DESCRIPTOR.enum_types_by_name["BatchOperationType"] 23 | BatchOperationType = enum_type_wrapper.EnumTypeWrapper(_BATCHOPERATIONTYPE) 24 | _BATCHOPERATIONSTATE = DESCRIPTOR.enum_types_by_name["BatchOperationState"] 25 | BatchOperationState = enum_type_wrapper.EnumTypeWrapper(_BATCHOPERATIONSTATE) 26 | BATCH_OPERATION_TYPE_UNSPECIFIED = 0 27 | BATCH_OPERATION_TYPE_TERMINATE = 1 28 | BATCH_OPERATION_TYPE_CANCEL = 2 29 | BATCH_OPERATION_TYPE_SIGNAL = 3 30 | BATCH_OPERATION_TYPE_DELETE = 4 31 | BATCH_OPERATION_TYPE_RESET = 5 32 | BATCH_OPERATION_TYPE_UPDATE_EXECUTION_OPTIONS = 6 33 | BATCH_OPERATION_STATE_UNSPECIFIED = 0 34 | BATCH_OPERATION_STATE_RUNNING = 1 35 | BATCH_OPERATION_STATE_COMPLETED = 2 36 | BATCH_OPERATION_STATE_FAILED = 3 37 | 38 | 39 | if _descriptor._USE_C_DESCRIPTORS == False: 40 | DESCRIPTOR._options = None 41 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\023BatchOperationProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 42 | _BATCHOPERATIONTYPE._serialized_start = 71 43 | _BATCHOPERATIONTYPE._serialized_end = 347 44 | _BATCHOPERATIONSTATE._serialized_start = 350 45 | _BATCHOPERATIONSTATE._serialized_end = 516 46 | # @@protoc_insertion_point(module_scope) 47 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/batch_operation_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | import typing 9 | 10 | import google.protobuf.descriptor 11 | import google.protobuf.internal.enum_type_wrapper 12 | 13 | if sys.version_info >= (3, 10): 14 | import typing as typing_extensions 15 | else: 16 | import typing_extensions 17 | 18 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 19 | 20 | class _BatchOperationType: 21 | ValueType = typing.NewType("ValueType", builtins.int) 22 | V: typing_extensions.TypeAlias = ValueType 23 | 24 | class _BatchOperationTypeEnumTypeWrapper( 25 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 26 | _BatchOperationType.ValueType 27 | ], 28 | builtins.type, 29 | ): # noqa: F821 30 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 31 | BATCH_OPERATION_TYPE_UNSPECIFIED: _BatchOperationType.ValueType # 0 32 | BATCH_OPERATION_TYPE_TERMINATE: _BatchOperationType.ValueType # 1 33 | BATCH_OPERATION_TYPE_CANCEL: _BatchOperationType.ValueType # 2 34 | BATCH_OPERATION_TYPE_SIGNAL: _BatchOperationType.ValueType # 3 35 | BATCH_OPERATION_TYPE_DELETE: _BatchOperationType.ValueType # 4 36 | BATCH_OPERATION_TYPE_RESET: _BatchOperationType.ValueType # 5 37 | BATCH_OPERATION_TYPE_UPDATE_EXECUTION_OPTIONS: _BatchOperationType.ValueType # 6 38 | 39 | class BatchOperationType( 40 | _BatchOperationType, metaclass=_BatchOperationTypeEnumTypeWrapper 41 | ): ... 42 | 43 | BATCH_OPERATION_TYPE_UNSPECIFIED: BatchOperationType.ValueType # 0 44 | BATCH_OPERATION_TYPE_TERMINATE: BatchOperationType.ValueType # 1 45 | BATCH_OPERATION_TYPE_CANCEL: BatchOperationType.ValueType # 2 46 | BATCH_OPERATION_TYPE_SIGNAL: BatchOperationType.ValueType # 3 47 | BATCH_OPERATION_TYPE_DELETE: BatchOperationType.ValueType # 4 48 | BATCH_OPERATION_TYPE_RESET: BatchOperationType.ValueType # 5 49 | BATCH_OPERATION_TYPE_UPDATE_EXECUTION_OPTIONS: BatchOperationType.ValueType # 6 50 | global___BatchOperationType = BatchOperationType 51 | 52 | class _BatchOperationState: 53 | ValueType = typing.NewType("ValueType", builtins.int) 54 | V: typing_extensions.TypeAlias = ValueType 55 | 56 | class _BatchOperationStateEnumTypeWrapper( 57 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 58 | _BatchOperationState.ValueType 59 | ], 60 | builtins.type, 61 | ): # noqa: F821 62 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 63 | BATCH_OPERATION_STATE_UNSPECIFIED: _BatchOperationState.ValueType # 0 64 | BATCH_OPERATION_STATE_RUNNING: _BatchOperationState.ValueType # 1 65 | BATCH_OPERATION_STATE_COMPLETED: _BatchOperationState.ValueType # 2 66 | BATCH_OPERATION_STATE_FAILED: _BatchOperationState.ValueType # 3 67 | 68 | class BatchOperationState( 69 | _BatchOperationState, metaclass=_BatchOperationStateEnumTypeWrapper 70 | ): ... 71 | 72 | BATCH_OPERATION_STATE_UNSPECIFIED: BatchOperationState.ValueType # 0 73 | BATCH_OPERATION_STATE_RUNNING: BatchOperationState.ValueType # 1 74 | BATCH_OPERATION_STATE_COMPLETED: BatchOperationState.ValueType # 2 75 | BATCH_OPERATION_STATE_FAILED: BatchOperationState.ValueType # 3 76 | global___BatchOperationState = BatchOperationState 77 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/command_type_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/command_type.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b"\n(temporal/api/enums/v1/command_type.proto\x12\x15temporal.api.enums.v1*\x9c\x06\n\x0b\x43ommandType\x12\x1c\n\x18\x43OMMAND_TYPE_UNSPECIFIED\x10\x00\x12'\n#COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK\x10\x01\x12-\n)COMMAND_TYPE_REQUEST_CANCEL_ACTIVITY_TASK\x10\x02\x12\x1c\n\x18\x43OMMAND_TYPE_START_TIMER\x10\x03\x12,\n(COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION\x10\x04\x12(\n$COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION\x10\x05\x12\x1d\n\x19\x43OMMAND_TYPE_CANCEL_TIMER\x10\x06\x12*\n&COMMAND_TYPE_CANCEL_WORKFLOW_EXECUTION\x10\x07\x12;\n7COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION\x10\x08\x12\x1e\n\x1a\x43OMMAND_TYPE_RECORD_MARKER\x10\t\x12\x33\n/COMMAND_TYPE_CONTINUE_AS_NEW_WORKFLOW_EXECUTION\x10\n\x12/\n+COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION\x10\x0b\x12\x33\n/COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION\x10\x0c\x12\x32\n.COMMAND_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES\x10\r\x12!\n\x1d\x43OMMAND_TYPE_PROTOCOL_MESSAGE\x10\x0e\x12+\n'COMMAND_TYPE_MODIFY_WORKFLOW_PROPERTIES\x10\x10\x12)\n%COMMAND_TYPE_SCHEDULE_NEXUS_OPERATION\x10\x11\x12/\n+COMMAND_TYPE_REQUEST_CANCEL_NEXUS_OPERATION\x10\x12\x42\x88\x01\n\x18io.temporal.api.enums.v1B\x10\x43ommandTypeProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3" 20 | ) 21 | 22 | _COMMANDTYPE = DESCRIPTOR.enum_types_by_name["CommandType"] 23 | CommandType = enum_type_wrapper.EnumTypeWrapper(_COMMANDTYPE) 24 | COMMAND_TYPE_UNSPECIFIED = 0 25 | COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK = 1 26 | COMMAND_TYPE_REQUEST_CANCEL_ACTIVITY_TASK = 2 27 | COMMAND_TYPE_START_TIMER = 3 28 | COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION = 4 29 | COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION = 5 30 | COMMAND_TYPE_CANCEL_TIMER = 6 31 | COMMAND_TYPE_CANCEL_WORKFLOW_EXECUTION = 7 32 | COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION = 8 33 | COMMAND_TYPE_RECORD_MARKER = 9 34 | COMMAND_TYPE_CONTINUE_AS_NEW_WORKFLOW_EXECUTION = 10 35 | COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION = 11 36 | COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION = 12 37 | COMMAND_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES = 13 38 | COMMAND_TYPE_PROTOCOL_MESSAGE = 14 39 | COMMAND_TYPE_MODIFY_WORKFLOW_PROPERTIES = 16 40 | COMMAND_TYPE_SCHEDULE_NEXUS_OPERATION = 17 41 | COMMAND_TYPE_REQUEST_CANCEL_NEXUS_OPERATION = 18 42 | 43 | 44 | if _descriptor._USE_C_DESCRIPTORS == False: 45 | DESCRIPTOR._options = None 46 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\020CommandTypeProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 47 | _COMMANDTYPE._serialized_start = 68 48 | _COMMANDTYPE._serialized_end = 864 49 | # @@protoc_insertion_point(module_scope) 50 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/deployment_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/deployment.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b"\n&temporal/api/enums/v1/deployment.proto\x12\x15temporal.api.enums.v1*\xc4\x01\n\x16\x44\x65ploymentReachability\x12'\n#DEPLOYMENT_REACHABILITY_UNSPECIFIED\x10\x00\x12%\n!DEPLOYMENT_REACHABILITY_REACHABLE\x10\x01\x12\x31\n-DEPLOYMENT_REACHABILITY_CLOSED_WORKFLOWS_ONLY\x10\x02\x12'\n#DEPLOYMENT_REACHABILITY_UNREACHABLE\x10\x03*\x8b\x01\n\x15VersionDrainageStatus\x12'\n#VERSION_DRAINAGE_STATUS_UNSPECIFIED\x10\x00\x12$\n VERSION_DRAINAGE_STATUS_DRAINING\x10\x01\x12#\n\x1fVERSION_DRAINAGE_STATUS_DRAINED\x10\x02*\x8c\x01\n\x14WorkerVersioningMode\x12&\n\"WORKER_VERSIONING_MODE_UNSPECIFIED\x10\x00\x12&\n\"WORKER_VERSIONING_MODE_UNVERSIONED\x10\x01\x12$\n WORKER_VERSIONING_MODE_VERSIONED\x10\x02\x42\x87\x01\n\x18io.temporal.api.enums.v1B\x0f\x44\x65ploymentProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3" 20 | ) 21 | 22 | _DEPLOYMENTREACHABILITY = DESCRIPTOR.enum_types_by_name["DeploymentReachability"] 23 | DeploymentReachability = enum_type_wrapper.EnumTypeWrapper(_DEPLOYMENTREACHABILITY) 24 | _VERSIONDRAINAGESTATUS = DESCRIPTOR.enum_types_by_name["VersionDrainageStatus"] 25 | VersionDrainageStatus = enum_type_wrapper.EnumTypeWrapper(_VERSIONDRAINAGESTATUS) 26 | _WORKERVERSIONINGMODE = DESCRIPTOR.enum_types_by_name["WorkerVersioningMode"] 27 | WorkerVersioningMode = enum_type_wrapper.EnumTypeWrapper(_WORKERVERSIONINGMODE) 28 | DEPLOYMENT_REACHABILITY_UNSPECIFIED = 0 29 | DEPLOYMENT_REACHABILITY_REACHABLE = 1 30 | DEPLOYMENT_REACHABILITY_CLOSED_WORKFLOWS_ONLY = 2 31 | DEPLOYMENT_REACHABILITY_UNREACHABLE = 3 32 | VERSION_DRAINAGE_STATUS_UNSPECIFIED = 0 33 | VERSION_DRAINAGE_STATUS_DRAINING = 1 34 | VERSION_DRAINAGE_STATUS_DRAINED = 2 35 | WORKER_VERSIONING_MODE_UNSPECIFIED = 0 36 | WORKER_VERSIONING_MODE_UNVERSIONED = 1 37 | WORKER_VERSIONING_MODE_VERSIONED = 2 38 | 39 | 40 | if _descriptor._USE_C_DESCRIPTORS == False: 41 | DESCRIPTOR._options = None 42 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\017DeploymentProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 43 | _DEPLOYMENTREACHABILITY._serialized_start = 66 44 | _DEPLOYMENTREACHABILITY._serialized_end = 262 45 | _VERSIONDRAINAGESTATUS._serialized_start = 265 46 | _VERSIONDRAINAGESTATUS._serialized_end = 404 47 | _WORKERVERSIONINGMODE._serialized_start = 407 48 | _WORKERVERSIONINGMODE._serialized_end = 547 49 | # @@protoc_insertion_point(module_scope) 50 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/namespace_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/namespace.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b"\n%temporal/api/enums/v1/namespace.proto\x12\x15temporal.api.enums.v1*\x8e\x01\n\x0eNamespaceState\x12\x1f\n\x1bNAMESPACE_STATE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aNAMESPACE_STATE_REGISTERED\x10\x01\x12\x1e\n\x1aNAMESPACE_STATE_DEPRECATED\x10\x02\x12\x1b\n\x17NAMESPACE_STATE_DELETED\x10\x03*h\n\rArchivalState\x12\x1e\n\x1a\x41RCHIVAL_STATE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x41RCHIVAL_STATE_DISABLED\x10\x01\x12\x1a\n\x16\x41RCHIVAL_STATE_ENABLED\x10\x02*s\n\x10ReplicationState\x12!\n\x1dREPLICATION_STATE_UNSPECIFIED\x10\x00\x12\x1c\n\x18REPLICATION_STATE_NORMAL\x10\x01\x12\x1e\n\x1aREPLICATION_STATE_HANDOVER\x10\x02\x42\x86\x01\n\x18io.temporal.api.enums.v1B\x0eNamespaceProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3" 20 | ) 21 | 22 | _NAMESPACESTATE = DESCRIPTOR.enum_types_by_name["NamespaceState"] 23 | NamespaceState = enum_type_wrapper.EnumTypeWrapper(_NAMESPACESTATE) 24 | _ARCHIVALSTATE = DESCRIPTOR.enum_types_by_name["ArchivalState"] 25 | ArchivalState = enum_type_wrapper.EnumTypeWrapper(_ARCHIVALSTATE) 26 | _REPLICATIONSTATE = DESCRIPTOR.enum_types_by_name["ReplicationState"] 27 | ReplicationState = enum_type_wrapper.EnumTypeWrapper(_REPLICATIONSTATE) 28 | NAMESPACE_STATE_UNSPECIFIED = 0 29 | NAMESPACE_STATE_REGISTERED = 1 30 | NAMESPACE_STATE_DEPRECATED = 2 31 | NAMESPACE_STATE_DELETED = 3 32 | ARCHIVAL_STATE_UNSPECIFIED = 0 33 | ARCHIVAL_STATE_DISABLED = 1 34 | ARCHIVAL_STATE_ENABLED = 2 35 | REPLICATION_STATE_UNSPECIFIED = 0 36 | REPLICATION_STATE_NORMAL = 1 37 | REPLICATION_STATE_HANDOVER = 2 38 | 39 | 40 | if _descriptor._USE_C_DESCRIPTORS == False: 41 | DESCRIPTOR._options = None 42 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\016NamespaceProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 43 | _NAMESPACESTATE._serialized_start = 65 44 | _NAMESPACESTATE._serialized_end = 207 45 | _ARCHIVALSTATE._serialized_start = 209 46 | _ARCHIVALSTATE._serialized_end = 313 47 | _REPLICATIONSTATE._serialized_start = 315 48 | _REPLICATIONSTATE._serialized_end = 430 49 | # @@protoc_insertion_point(module_scope) 50 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/namespace_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | import typing 9 | 10 | import google.protobuf.descriptor 11 | import google.protobuf.internal.enum_type_wrapper 12 | 13 | if sys.version_info >= (3, 10): 14 | import typing as typing_extensions 15 | else: 16 | import typing_extensions 17 | 18 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 19 | 20 | class _NamespaceState: 21 | ValueType = typing.NewType("ValueType", builtins.int) 22 | V: typing_extensions.TypeAlias = ValueType 23 | 24 | class _NamespaceStateEnumTypeWrapper( 25 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 26 | _NamespaceState.ValueType 27 | ], 28 | builtins.type, 29 | ): # noqa: F821 30 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 31 | NAMESPACE_STATE_UNSPECIFIED: _NamespaceState.ValueType # 0 32 | NAMESPACE_STATE_REGISTERED: _NamespaceState.ValueType # 1 33 | NAMESPACE_STATE_DEPRECATED: _NamespaceState.ValueType # 2 34 | NAMESPACE_STATE_DELETED: _NamespaceState.ValueType # 3 35 | 36 | class NamespaceState(_NamespaceState, metaclass=_NamespaceStateEnumTypeWrapper): ... 37 | 38 | NAMESPACE_STATE_UNSPECIFIED: NamespaceState.ValueType # 0 39 | NAMESPACE_STATE_REGISTERED: NamespaceState.ValueType # 1 40 | NAMESPACE_STATE_DEPRECATED: NamespaceState.ValueType # 2 41 | NAMESPACE_STATE_DELETED: NamespaceState.ValueType # 3 42 | global___NamespaceState = NamespaceState 43 | 44 | class _ArchivalState: 45 | ValueType = typing.NewType("ValueType", builtins.int) 46 | V: typing_extensions.TypeAlias = ValueType 47 | 48 | class _ArchivalStateEnumTypeWrapper( 49 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 50 | _ArchivalState.ValueType 51 | ], 52 | builtins.type, 53 | ): # noqa: F821 54 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 55 | ARCHIVAL_STATE_UNSPECIFIED: _ArchivalState.ValueType # 0 56 | ARCHIVAL_STATE_DISABLED: _ArchivalState.ValueType # 1 57 | ARCHIVAL_STATE_ENABLED: _ArchivalState.ValueType # 2 58 | 59 | class ArchivalState(_ArchivalState, metaclass=_ArchivalStateEnumTypeWrapper): ... 60 | 61 | ARCHIVAL_STATE_UNSPECIFIED: ArchivalState.ValueType # 0 62 | ARCHIVAL_STATE_DISABLED: ArchivalState.ValueType # 1 63 | ARCHIVAL_STATE_ENABLED: ArchivalState.ValueType # 2 64 | global___ArchivalState = ArchivalState 65 | 66 | class _ReplicationState: 67 | ValueType = typing.NewType("ValueType", builtins.int) 68 | V: typing_extensions.TypeAlias = ValueType 69 | 70 | class _ReplicationStateEnumTypeWrapper( 71 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 72 | _ReplicationState.ValueType 73 | ], 74 | builtins.type, 75 | ): # noqa: F821 76 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 77 | REPLICATION_STATE_UNSPECIFIED: _ReplicationState.ValueType # 0 78 | REPLICATION_STATE_NORMAL: _ReplicationState.ValueType # 1 79 | REPLICATION_STATE_HANDOVER: _ReplicationState.ValueType # 2 80 | 81 | class ReplicationState( 82 | _ReplicationState, metaclass=_ReplicationStateEnumTypeWrapper 83 | ): ... 84 | 85 | REPLICATION_STATE_UNSPECIFIED: ReplicationState.ValueType # 0 86 | REPLICATION_STATE_NORMAL: ReplicationState.ValueType # 1 87 | REPLICATION_STATE_HANDOVER: ReplicationState.ValueType # 2 88 | global___ReplicationState = ReplicationState 89 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/nexus_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/nexus.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b"\n!temporal/api/enums/v1/nexus.proto\x12\x15temporal.api.enums.v1*\xbc\x01\n\x1eNexusHandlerErrorRetryBehavior\x12\x32\n.NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x30\n,NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_RETRYABLE\x10\x01\x12\x34\n0NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_NON_RETRYABLE\x10\x02\x42\x82\x01\n\x18io.temporal.api.enums.v1B\nNexusProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3" 20 | ) 21 | 22 | _NEXUSHANDLERERRORRETRYBEHAVIOR = DESCRIPTOR.enum_types_by_name[ 23 | "NexusHandlerErrorRetryBehavior" 24 | ] 25 | NexusHandlerErrorRetryBehavior = enum_type_wrapper.EnumTypeWrapper( 26 | _NEXUSHANDLERERRORRETRYBEHAVIOR 27 | ) 28 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_UNSPECIFIED = 0 29 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_RETRYABLE = 1 30 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_NON_RETRYABLE = 2 31 | 32 | 33 | if _descriptor._USE_C_DESCRIPTORS == False: 34 | DESCRIPTOR._options = None 35 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\nNexusProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 36 | _NEXUSHANDLERERRORRETRYBEHAVIOR._serialized_start = 61 37 | _NEXUSHANDLERERRORRETRYBEHAVIOR._serialized_end = 249 38 | # @@protoc_insertion_point(module_scope) 39 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/nexus_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | import typing 9 | 10 | import google.protobuf.descriptor 11 | import google.protobuf.internal.enum_type_wrapper 12 | 13 | if sys.version_info >= (3, 10): 14 | import typing as typing_extensions 15 | else: 16 | import typing_extensions 17 | 18 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 19 | 20 | class _NexusHandlerErrorRetryBehavior: 21 | ValueType = typing.NewType("ValueType", builtins.int) 22 | V: typing_extensions.TypeAlias = ValueType 23 | 24 | class _NexusHandlerErrorRetryBehaviorEnumTypeWrapper( 25 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 26 | _NexusHandlerErrorRetryBehavior.ValueType 27 | ], 28 | builtins.type, 29 | ): # noqa: F821 30 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 31 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_UNSPECIFIED: ( 32 | _NexusHandlerErrorRetryBehavior.ValueType 33 | ) # 0 34 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_RETRYABLE: ( 35 | _NexusHandlerErrorRetryBehavior.ValueType 36 | ) # 1 37 | """A handler error is explicitly marked as retryable.""" 38 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_NON_RETRYABLE: ( 39 | _NexusHandlerErrorRetryBehavior.ValueType 40 | ) # 2 41 | """A handler error is explicitly marked as non-retryable.""" 42 | 43 | class NexusHandlerErrorRetryBehavior( 44 | _NexusHandlerErrorRetryBehavior, 45 | metaclass=_NexusHandlerErrorRetryBehaviorEnumTypeWrapper, 46 | ): 47 | """NexusHandlerErrorRetryBehavior allows nexus handlers to explicity set the retry behavior of a HandlerError. If not 48 | specified, retry behavior is determined from the error type. For example internal errors are not retryable by default 49 | unless specified otherwise. 50 | """ 51 | 52 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_UNSPECIFIED: ( 53 | NexusHandlerErrorRetryBehavior.ValueType 54 | ) # 0 55 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_RETRYABLE: ( 56 | NexusHandlerErrorRetryBehavior.ValueType 57 | ) # 1 58 | """A handler error is explicitly marked as retryable.""" 59 | NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_NON_RETRYABLE: ( 60 | NexusHandlerErrorRetryBehavior.ValueType 61 | ) # 2 62 | """A handler error is explicitly marked as non-retryable.""" 63 | global___NexusHandlerErrorRetryBehavior = NexusHandlerErrorRetryBehavior 64 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/query_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/query.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b'\n!temporal/api/enums/v1/query.proto\x12\x15temporal.api.enums.v1*r\n\x0fQueryResultType\x12!\n\x1dQUERY_RESULT_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aQUERY_RESULT_TYPE_ANSWERED\x10\x01\x12\x1c\n\x18QUERY_RESULT_TYPE_FAILED\x10\x02*\xb6\x01\n\x14QueryRejectCondition\x12&\n"QUERY_REJECT_CONDITION_UNSPECIFIED\x10\x00\x12\x1f\n\x1bQUERY_REJECT_CONDITION_NONE\x10\x01\x12#\n\x1fQUERY_REJECT_CONDITION_NOT_OPEN\x10\x02\x12\x30\n,QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY\x10\x03\x42\x82\x01\n\x18io.temporal.api.enums.v1B\nQueryProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3' 20 | ) 21 | 22 | _QUERYRESULTTYPE = DESCRIPTOR.enum_types_by_name["QueryResultType"] 23 | QueryResultType = enum_type_wrapper.EnumTypeWrapper(_QUERYRESULTTYPE) 24 | _QUERYREJECTCONDITION = DESCRIPTOR.enum_types_by_name["QueryRejectCondition"] 25 | QueryRejectCondition = enum_type_wrapper.EnumTypeWrapper(_QUERYREJECTCONDITION) 26 | QUERY_RESULT_TYPE_UNSPECIFIED = 0 27 | QUERY_RESULT_TYPE_ANSWERED = 1 28 | QUERY_RESULT_TYPE_FAILED = 2 29 | QUERY_REJECT_CONDITION_UNSPECIFIED = 0 30 | QUERY_REJECT_CONDITION_NONE = 1 31 | QUERY_REJECT_CONDITION_NOT_OPEN = 2 32 | QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY = 3 33 | 34 | 35 | if _descriptor._USE_C_DESCRIPTORS == False: 36 | DESCRIPTOR._options = None 37 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\nQueryProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 38 | _QUERYRESULTTYPE._serialized_start = 60 39 | _QUERYRESULTTYPE._serialized_end = 174 40 | _QUERYREJECTCONDITION._serialized_start = 177 41 | _QUERYREJECTCONDITION._serialized_end = 359 42 | # @@protoc_insertion_point(module_scope) 43 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/query_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | import typing 9 | 10 | import google.protobuf.descriptor 11 | import google.protobuf.internal.enum_type_wrapper 12 | 13 | if sys.version_info >= (3, 10): 14 | import typing as typing_extensions 15 | else: 16 | import typing_extensions 17 | 18 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 19 | 20 | class _QueryResultType: 21 | ValueType = typing.NewType("ValueType", builtins.int) 22 | V: typing_extensions.TypeAlias = ValueType 23 | 24 | class _QueryResultTypeEnumTypeWrapper( 25 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 26 | _QueryResultType.ValueType 27 | ], 28 | builtins.type, 29 | ): # noqa: F821 30 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 31 | QUERY_RESULT_TYPE_UNSPECIFIED: _QueryResultType.ValueType # 0 32 | QUERY_RESULT_TYPE_ANSWERED: _QueryResultType.ValueType # 1 33 | QUERY_RESULT_TYPE_FAILED: _QueryResultType.ValueType # 2 34 | 35 | class QueryResultType(_QueryResultType, metaclass=_QueryResultTypeEnumTypeWrapper): ... 36 | 37 | QUERY_RESULT_TYPE_UNSPECIFIED: QueryResultType.ValueType # 0 38 | QUERY_RESULT_TYPE_ANSWERED: QueryResultType.ValueType # 1 39 | QUERY_RESULT_TYPE_FAILED: QueryResultType.ValueType # 2 40 | global___QueryResultType = QueryResultType 41 | 42 | class _QueryRejectCondition: 43 | ValueType = typing.NewType("ValueType", builtins.int) 44 | V: typing_extensions.TypeAlias = ValueType 45 | 46 | class _QueryRejectConditionEnumTypeWrapper( 47 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 48 | _QueryRejectCondition.ValueType 49 | ], 50 | builtins.type, 51 | ): # noqa: F821 52 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 53 | QUERY_REJECT_CONDITION_UNSPECIFIED: _QueryRejectCondition.ValueType # 0 54 | QUERY_REJECT_CONDITION_NONE: _QueryRejectCondition.ValueType # 1 55 | """None indicates that query should not be rejected.""" 56 | QUERY_REJECT_CONDITION_NOT_OPEN: _QueryRejectCondition.ValueType # 2 57 | """NotOpen indicates that query should be rejected if workflow is not open.""" 58 | QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY: _QueryRejectCondition.ValueType # 3 59 | """NotCompletedCleanly indicates that query should be rejected if workflow did not complete cleanly.""" 60 | 61 | class QueryRejectCondition( 62 | _QueryRejectCondition, metaclass=_QueryRejectConditionEnumTypeWrapper 63 | ): ... 64 | 65 | QUERY_REJECT_CONDITION_UNSPECIFIED: QueryRejectCondition.ValueType # 0 66 | QUERY_REJECT_CONDITION_NONE: QueryRejectCondition.ValueType # 1 67 | """None indicates that query should not be rejected.""" 68 | QUERY_REJECT_CONDITION_NOT_OPEN: QueryRejectCondition.ValueType # 2 69 | """NotOpen indicates that query should be rejected if workflow is not open.""" 70 | QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY: QueryRejectCondition.ValueType # 3 71 | """NotCompletedCleanly indicates that query should be rejected if workflow did not complete cleanly.""" 72 | global___QueryRejectCondition = QueryRejectCondition 73 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/reset_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/reset.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b'\n!temporal/api/enums/v1/reset.proto\x12\x15temporal.api.enums.v1*\xec\x01\n\x17ResetReapplyExcludeType\x12*\n&RESET_REAPPLY_EXCLUDE_TYPE_UNSPECIFIED\x10\x00\x12%\n!RESET_REAPPLY_EXCLUDE_TYPE_SIGNAL\x10\x01\x12%\n!RESET_REAPPLY_EXCLUDE_TYPE_UPDATE\x10\x02\x12$\n RESET_REAPPLY_EXCLUDE_TYPE_NEXUS\x10\x03\x12\x31\n)RESET_REAPPLY_EXCLUDE_TYPE_CANCEL_REQUEST\x10\x04\x1a\x02\x08\x01*\x97\x01\n\x10ResetReapplyType\x12"\n\x1eRESET_REAPPLY_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19RESET_REAPPLY_TYPE_SIGNAL\x10\x01\x12\x1b\n\x17RESET_REAPPLY_TYPE_NONE\x10\x02\x12#\n\x1fRESET_REAPPLY_TYPE_ALL_ELIGIBLE\x10\x03*n\n\tResetType\x12\x1a\n\x16RESET_TYPE_UNSPECIFIED\x10\x00\x12"\n\x1eRESET_TYPE_FIRST_WORKFLOW_TASK\x10\x01\x12!\n\x1dRESET_TYPE_LAST_WORKFLOW_TASK\x10\x02\x42\x82\x01\n\x18io.temporal.api.enums.v1B\nResetProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3' 20 | ) 21 | 22 | _RESETREAPPLYEXCLUDETYPE = DESCRIPTOR.enum_types_by_name["ResetReapplyExcludeType"] 23 | ResetReapplyExcludeType = enum_type_wrapper.EnumTypeWrapper(_RESETREAPPLYEXCLUDETYPE) 24 | _RESETREAPPLYTYPE = DESCRIPTOR.enum_types_by_name["ResetReapplyType"] 25 | ResetReapplyType = enum_type_wrapper.EnumTypeWrapper(_RESETREAPPLYTYPE) 26 | _RESETTYPE = DESCRIPTOR.enum_types_by_name["ResetType"] 27 | ResetType = enum_type_wrapper.EnumTypeWrapper(_RESETTYPE) 28 | RESET_REAPPLY_EXCLUDE_TYPE_UNSPECIFIED = 0 29 | RESET_REAPPLY_EXCLUDE_TYPE_SIGNAL = 1 30 | RESET_REAPPLY_EXCLUDE_TYPE_UPDATE = 2 31 | RESET_REAPPLY_EXCLUDE_TYPE_NEXUS = 3 32 | RESET_REAPPLY_EXCLUDE_TYPE_CANCEL_REQUEST = 4 33 | RESET_REAPPLY_TYPE_UNSPECIFIED = 0 34 | RESET_REAPPLY_TYPE_SIGNAL = 1 35 | RESET_REAPPLY_TYPE_NONE = 2 36 | RESET_REAPPLY_TYPE_ALL_ELIGIBLE = 3 37 | RESET_TYPE_UNSPECIFIED = 0 38 | RESET_TYPE_FIRST_WORKFLOW_TASK = 1 39 | RESET_TYPE_LAST_WORKFLOW_TASK = 2 40 | 41 | 42 | if _descriptor._USE_C_DESCRIPTORS == False: 43 | DESCRIPTOR._options = None 44 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\nResetProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 45 | _RESETREAPPLYEXCLUDETYPE.values_by_name[ 46 | "RESET_REAPPLY_EXCLUDE_TYPE_CANCEL_REQUEST" 47 | ]._options = None 48 | _RESETREAPPLYEXCLUDETYPE.values_by_name[ 49 | "RESET_REAPPLY_EXCLUDE_TYPE_CANCEL_REQUEST" 50 | ]._serialized_options = b"\010\001" 51 | _RESETREAPPLYEXCLUDETYPE._serialized_start = 61 52 | _RESETREAPPLYEXCLUDETYPE._serialized_end = 297 53 | _RESETREAPPLYTYPE._serialized_start = 300 54 | _RESETREAPPLYTYPE._serialized_end = 451 55 | _RESETTYPE._serialized_start = 453 56 | _RESETTYPE._serialized_end = 563 57 | # @@protoc_insertion_point(module_scope) 58 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/schedule_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/schedule.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b"\n$temporal/api/enums/v1/schedule.proto\x12\x15temporal.api.enums.v1*\xb0\x02\n\x15ScheduleOverlapPolicy\x12'\n#SCHEDULE_OVERLAP_POLICY_UNSPECIFIED\x10\x00\x12 \n\x1cSCHEDULE_OVERLAP_POLICY_SKIP\x10\x01\x12&\n\"SCHEDULE_OVERLAP_POLICY_BUFFER_ONE\x10\x02\x12&\n\"SCHEDULE_OVERLAP_POLICY_BUFFER_ALL\x10\x03\x12(\n$SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER\x10\x04\x12+\n'SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER\x10\x05\x12%\n!SCHEDULE_OVERLAP_POLICY_ALLOW_ALL\x10\x06\x42\x85\x01\n\x18io.temporal.api.enums.v1B\rScheduleProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3" 20 | ) 21 | 22 | _SCHEDULEOVERLAPPOLICY = DESCRIPTOR.enum_types_by_name["ScheduleOverlapPolicy"] 23 | ScheduleOverlapPolicy = enum_type_wrapper.EnumTypeWrapper(_SCHEDULEOVERLAPPOLICY) 24 | SCHEDULE_OVERLAP_POLICY_UNSPECIFIED = 0 25 | SCHEDULE_OVERLAP_POLICY_SKIP = 1 26 | SCHEDULE_OVERLAP_POLICY_BUFFER_ONE = 2 27 | SCHEDULE_OVERLAP_POLICY_BUFFER_ALL = 3 28 | SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER = 4 29 | SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER = 5 30 | SCHEDULE_OVERLAP_POLICY_ALLOW_ALL = 6 31 | 32 | 33 | if _descriptor._USE_C_DESCRIPTORS == False: 34 | DESCRIPTOR._options = None 35 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\rScheduleProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 36 | _SCHEDULEOVERLAPPOLICY._serialized_start = 64 37 | _SCHEDULEOVERLAPPOLICY._serialized_end = 368 38 | # @@protoc_insertion_point(module_scope) 39 | -------------------------------------------------------------------------------- /temporalio/api/enums/v1/update_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/enums/v1/update.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 19 | b'\n"temporal/api/enums/v1/update.proto\x12\x15temporal.api.enums.v1*\x8b\x02\n%UpdateWorkflowExecutionLifecycleStage\x12\x39\n5UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED\x10\x00\x12\x36\n2UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED\x10\x01\x12\x36\n2UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED\x10\x02\x12\x37\n3UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED\x10\x03*s\n\x19UpdateAdmittedEventOrigin\x12,\n(UPDATE_ADMITTED_EVENT_ORIGIN_UNSPECIFIED\x10\x00\x12(\n$UPDATE_ADMITTED_EVENT_ORIGIN_REAPPLY\x10\x01\x42\x83\x01\n\x18io.temporal.api.enums.v1B\x0bUpdateProtoP\x01Z!go.temporal.io/api/enums/v1;enums\xaa\x02\x17Temporalio.Api.Enums.V1\xea\x02\x1aTemporalio::Api::Enums::V1b\x06proto3' 20 | ) 21 | 22 | _UPDATEWORKFLOWEXECUTIONLIFECYCLESTAGE = DESCRIPTOR.enum_types_by_name[ 23 | "UpdateWorkflowExecutionLifecycleStage" 24 | ] 25 | UpdateWorkflowExecutionLifecycleStage = enum_type_wrapper.EnumTypeWrapper( 26 | _UPDATEWORKFLOWEXECUTIONLIFECYCLESTAGE 27 | ) 28 | _UPDATEADMITTEDEVENTORIGIN = DESCRIPTOR.enum_types_by_name["UpdateAdmittedEventOrigin"] 29 | UpdateAdmittedEventOrigin = enum_type_wrapper.EnumTypeWrapper( 30 | _UPDATEADMITTEDEVENTORIGIN 31 | ) 32 | UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED = 0 33 | UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED = 1 34 | UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED = 2 35 | UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED = 3 36 | UPDATE_ADMITTED_EVENT_ORIGIN_UNSPECIFIED = 0 37 | UPDATE_ADMITTED_EVENT_ORIGIN_REAPPLY = 1 38 | 39 | 40 | if _descriptor._USE_C_DESCRIPTORS == False: 41 | DESCRIPTOR._options = None 42 | DESCRIPTOR._serialized_options = b"\n\030io.temporal.api.enums.v1B\013UpdateProtoP\001Z!go.temporal.io/api/enums/v1;enums\252\002\027Temporalio.Api.Enums.V1\352\002\032Temporalio::Api::Enums::V1" 43 | _UPDATEWORKFLOWEXECUTIONLIFECYCLESTAGE._serialized_start = 62 44 | _UPDATEWORKFLOWEXECUTIONLIFECYCLESTAGE._serialized_end = 329 45 | _UPDATEADMITTEDEVENTORIGIN._serialized_start = 331 46 | _UPDATEADMITTEDEVENTORIGIN._serialized_end = 446 47 | # @@protoc_insertion_point(module_scope) 48 | -------------------------------------------------------------------------------- /temporalio/api/errordetails/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/errordetails/__init__.py -------------------------------------------------------------------------------- /temporalio/api/errordetails/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | CancellationAlreadyRequestedFailure, 3 | ClientVersionNotSupportedFailure, 4 | MultiOperationExecutionFailure, 5 | NamespaceAlreadyExistsFailure, 6 | NamespaceInvalidStateFailure, 7 | NamespaceNotActiveFailure, 8 | NamespaceNotFoundFailure, 9 | NamespaceUnavailableFailure, 10 | NewerBuildExistsFailure, 11 | NotFoundFailure, 12 | PermissionDeniedFailure, 13 | QueryFailedFailure, 14 | ResourceExhaustedFailure, 15 | ServerVersionNotSupportedFailure, 16 | SystemWorkflowFailure, 17 | WorkflowExecutionAlreadyStartedFailure, 18 | WorkflowNotReadyFailure, 19 | ) 20 | 21 | __all__ = [ 22 | "CancellationAlreadyRequestedFailure", 23 | "ClientVersionNotSupportedFailure", 24 | "MultiOperationExecutionFailure", 25 | "NamespaceAlreadyExistsFailure", 26 | "NamespaceInvalidStateFailure", 27 | "NamespaceNotActiveFailure", 28 | "NamespaceNotFoundFailure", 29 | "NamespaceUnavailableFailure", 30 | "NewerBuildExistsFailure", 31 | "NotFoundFailure", 32 | "PermissionDeniedFailure", 33 | "QueryFailedFailure", 34 | "ResourceExhaustedFailure", 35 | "ServerVersionNotSupportedFailure", 36 | "SystemWorkflowFailure", 37 | "WorkflowExecutionAlreadyStartedFailure", 38 | "WorkflowNotReadyFailure", 39 | ] 40 | -------------------------------------------------------------------------------- /temporalio/api/export/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/export/__init__.py -------------------------------------------------------------------------------- /temporalio/api/export/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import WorkflowExecution, WorkflowExecutions 2 | 3 | __all__ = [ 4 | "WorkflowExecution", 5 | "WorkflowExecutions", 6 | ] 7 | -------------------------------------------------------------------------------- /temporalio/api/export/v1/message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/export/v1/message.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from temporalio.api.history.v1 import ( 18 | message_pb2 as temporal_dot_api_dot_history_dot_v1_dot_message__pb2, 19 | ) 20 | 21 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 22 | b'\n$temporal/api/export/v1/message.proto\x12\x16temporal.api.export.v1\x1a%temporal/api/history/v1/message.proto"F\n\x11WorkflowExecution\x12\x31\n\x07history\x18\x01 \x01(\x0b\x32 .temporal.api.history.v1.History"N\n\x12WorkflowExecutions\x12\x38\n\x05items\x18\x01 \x03(\x0b\x32).temporal.api.export.v1.WorkflowExecutionB\x89\x01\n\x19io.temporal.api.export.v1B\x0cMessageProtoP\x01Z#go.temporal.io/api/export/v1;export\xaa\x02\x18Temporalio.Api.Export.V1\xea\x02\x1bTemporalio::Api::Export::V1b\x06proto3' 23 | ) 24 | 25 | 26 | _WORKFLOWEXECUTION = DESCRIPTOR.message_types_by_name["WorkflowExecution"] 27 | _WORKFLOWEXECUTIONS = DESCRIPTOR.message_types_by_name["WorkflowExecutions"] 28 | WorkflowExecution = _reflection.GeneratedProtocolMessageType( 29 | "WorkflowExecution", 30 | (_message.Message,), 31 | { 32 | "DESCRIPTOR": _WORKFLOWEXECUTION, 33 | "__module__": "temporal.api.export.v1.message_pb2", 34 | # @@protoc_insertion_point(class_scope:temporal.api.export.v1.WorkflowExecution) 35 | }, 36 | ) 37 | _sym_db.RegisterMessage(WorkflowExecution) 38 | 39 | WorkflowExecutions = _reflection.GeneratedProtocolMessageType( 40 | "WorkflowExecutions", 41 | (_message.Message,), 42 | { 43 | "DESCRIPTOR": _WORKFLOWEXECUTIONS, 44 | "__module__": "temporal.api.export.v1.message_pb2", 45 | # @@protoc_insertion_point(class_scope:temporal.api.export.v1.WorkflowExecutions) 46 | }, 47 | ) 48 | _sym_db.RegisterMessage(WorkflowExecutions) 49 | 50 | if _descriptor._USE_C_DESCRIPTORS == False: 51 | DESCRIPTOR._options = None 52 | DESCRIPTOR._serialized_options = b"\n\031io.temporal.api.export.v1B\014MessageProtoP\001Z#go.temporal.io/api/export/v1;export\252\002\030Temporalio.Api.Export.V1\352\002\033Temporalio::Api::Export::V1" 53 | _WORKFLOWEXECUTION._serialized_start = 103 54 | _WORKFLOWEXECUTION._serialized_end = 173 55 | _WORKFLOWEXECUTIONS._serialized_start = 175 56 | _WORKFLOWEXECUTIONS._serialized_end = 253 57 | # @@protoc_insertion_point(module_scope) 58 | -------------------------------------------------------------------------------- /temporalio/api/export/v1/message_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import collections.abc 8 | import sys 9 | 10 | import google.protobuf.descriptor 11 | import google.protobuf.internal.containers 12 | import google.protobuf.message 13 | 14 | import temporalio.api.history.v1.message_pb2 15 | 16 | if sys.version_info >= (3, 8): 17 | import typing as typing_extensions 18 | else: 19 | import typing_extensions 20 | 21 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 22 | 23 | class WorkflowExecution(google.protobuf.message.Message): 24 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 25 | 26 | HISTORY_FIELD_NUMBER: builtins.int 27 | @property 28 | def history(self) -> temporalio.api.history.v1.message_pb2.History: ... 29 | def __init__( 30 | self, 31 | *, 32 | history: temporalio.api.history.v1.message_pb2.History | None = ..., 33 | ) -> None: ... 34 | def HasField( 35 | self, field_name: typing_extensions.Literal["history", b"history"] 36 | ) -> builtins.bool: ... 37 | def ClearField( 38 | self, field_name: typing_extensions.Literal["history", b"history"] 39 | ) -> None: ... 40 | 41 | global___WorkflowExecution = WorkflowExecution 42 | 43 | class WorkflowExecutions(google.protobuf.message.Message): 44 | """WorkflowExecutions is used by the Cloud Export feature to deserialize 45 | the exported file. It encapsulates a collection of workflow execution information. 46 | """ 47 | 48 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 49 | 50 | ITEMS_FIELD_NUMBER: builtins.int 51 | @property 52 | def items( 53 | self, 54 | ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ 55 | global___WorkflowExecution 56 | ]: ... 57 | def __init__( 58 | self, 59 | *, 60 | items: collections.abc.Iterable[global___WorkflowExecution] | None = ..., 61 | ) -> None: ... 62 | def ClearField( 63 | self, field_name: typing_extensions.Literal["items", b"items"] 64 | ) -> None: ... 65 | 66 | global___WorkflowExecutions = WorkflowExecutions 67 | -------------------------------------------------------------------------------- /temporalio/api/failure/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/failure/__init__.py -------------------------------------------------------------------------------- /temporalio/api/failure/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | ActivityFailureInfo, 3 | ApplicationFailureInfo, 4 | CanceledFailureInfo, 5 | ChildWorkflowExecutionFailureInfo, 6 | Failure, 7 | MultiOperationExecutionAborted, 8 | NexusHandlerFailureInfo, 9 | NexusOperationFailureInfo, 10 | ResetWorkflowFailureInfo, 11 | ServerFailureInfo, 12 | TerminatedFailureInfo, 13 | TimeoutFailureInfo, 14 | ) 15 | 16 | __all__ = [ 17 | "ActivityFailureInfo", 18 | "ApplicationFailureInfo", 19 | "CanceledFailureInfo", 20 | "ChildWorkflowExecutionFailureInfo", 21 | "Failure", 22 | "MultiOperationExecutionAborted", 23 | "NexusHandlerFailureInfo", 24 | "NexusOperationFailureInfo", 25 | "ResetWorkflowFailureInfo", 26 | "ServerFailureInfo", 27 | "TerminatedFailureInfo", 28 | "TimeoutFailureInfo", 29 | ] 30 | -------------------------------------------------------------------------------- /temporalio/api/filter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/filter/__init__.py -------------------------------------------------------------------------------- /temporalio/api/filter/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | StartTimeFilter, 3 | StatusFilter, 4 | WorkflowExecutionFilter, 5 | WorkflowTypeFilter, 6 | ) 7 | 8 | __all__ = [ 9 | "StartTimeFilter", 10 | "StatusFilter", 11 | "WorkflowExecutionFilter", 12 | "WorkflowTypeFilter", 13 | ] 14 | -------------------------------------------------------------------------------- /temporalio/api/filter/v1/message_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | 9 | import google.protobuf.descriptor 10 | import google.protobuf.message 11 | import google.protobuf.timestamp_pb2 12 | 13 | import temporalio.api.enums.v1.workflow_pb2 14 | 15 | if sys.version_info >= (3, 8): 16 | import typing as typing_extensions 17 | else: 18 | import typing_extensions 19 | 20 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 21 | 22 | class WorkflowExecutionFilter(google.protobuf.message.Message): 23 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 24 | 25 | WORKFLOW_ID_FIELD_NUMBER: builtins.int 26 | RUN_ID_FIELD_NUMBER: builtins.int 27 | workflow_id: builtins.str 28 | run_id: builtins.str 29 | def __init__( 30 | self, 31 | *, 32 | workflow_id: builtins.str = ..., 33 | run_id: builtins.str = ..., 34 | ) -> None: ... 35 | def ClearField( 36 | self, 37 | field_name: typing_extensions.Literal[ 38 | "run_id", b"run_id", "workflow_id", b"workflow_id" 39 | ], 40 | ) -> None: ... 41 | 42 | global___WorkflowExecutionFilter = WorkflowExecutionFilter 43 | 44 | class WorkflowTypeFilter(google.protobuf.message.Message): 45 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 46 | 47 | NAME_FIELD_NUMBER: builtins.int 48 | name: builtins.str 49 | def __init__( 50 | self, 51 | *, 52 | name: builtins.str = ..., 53 | ) -> None: ... 54 | def ClearField( 55 | self, field_name: typing_extensions.Literal["name", b"name"] 56 | ) -> None: ... 57 | 58 | global___WorkflowTypeFilter = WorkflowTypeFilter 59 | 60 | class StartTimeFilter(google.protobuf.message.Message): 61 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 62 | 63 | EARLIEST_TIME_FIELD_NUMBER: builtins.int 64 | LATEST_TIME_FIELD_NUMBER: builtins.int 65 | @property 66 | def earliest_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ... 67 | @property 68 | def latest_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ... 69 | def __init__( 70 | self, 71 | *, 72 | earliest_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., 73 | latest_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., 74 | ) -> None: ... 75 | def HasField( 76 | self, 77 | field_name: typing_extensions.Literal[ 78 | "earliest_time", b"earliest_time", "latest_time", b"latest_time" 79 | ], 80 | ) -> builtins.bool: ... 81 | def ClearField( 82 | self, 83 | field_name: typing_extensions.Literal[ 84 | "earliest_time", b"earliest_time", "latest_time", b"latest_time" 85 | ], 86 | ) -> None: ... 87 | 88 | global___StartTimeFilter = StartTimeFilter 89 | 90 | class StatusFilter(google.protobuf.message.Message): 91 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 92 | 93 | STATUS_FIELD_NUMBER: builtins.int 94 | status: temporalio.api.enums.v1.workflow_pb2.WorkflowExecutionStatus.ValueType 95 | def __init__( 96 | self, 97 | *, 98 | status: temporalio.api.enums.v1.workflow_pb2.WorkflowExecutionStatus.ValueType = ..., 99 | ) -> None: ... 100 | def ClearField( 101 | self, field_name: typing_extensions.Literal["status", b"status"] 102 | ) -> None: ... 103 | 104 | global___StatusFilter = StatusFilter 105 | -------------------------------------------------------------------------------- /temporalio/api/history/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/history/__init__.py -------------------------------------------------------------------------------- /temporalio/api/interaction/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/interaction/__init__.py -------------------------------------------------------------------------------- /temporalio/api/interaction/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import Input, Invocation, Meta, Output 2 | 3 | __all__ = [ 4 | "Input", 5 | "Invocation", 6 | "Meta", 7 | "Output", 8 | ] 9 | -------------------------------------------------------------------------------- /temporalio/api/namespace/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/namespace/__init__.py -------------------------------------------------------------------------------- /temporalio/api/namespace/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | BadBinaries, 3 | BadBinaryInfo, 4 | NamespaceConfig, 5 | NamespaceFilter, 6 | NamespaceInfo, 7 | UpdateNamespaceInfo, 8 | ) 9 | 10 | __all__ = [ 11 | "BadBinaries", 12 | "BadBinaryInfo", 13 | "NamespaceConfig", 14 | "NamespaceFilter", 15 | "NamespaceInfo", 16 | "UpdateNamespaceInfo", 17 | ] 18 | -------------------------------------------------------------------------------- /temporalio/api/nexus/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/nexus/__init__.py -------------------------------------------------------------------------------- /temporalio/api/nexus/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | CancelOperationRequest, 3 | CancelOperationResponse, 4 | Endpoint, 5 | EndpointSpec, 6 | EndpointTarget, 7 | Failure, 8 | HandlerError, 9 | Link, 10 | Request, 11 | Response, 12 | StartOperationRequest, 13 | StartOperationResponse, 14 | UnsuccessfulOperationError, 15 | ) 16 | 17 | __all__ = [ 18 | "CancelOperationRequest", 19 | "CancelOperationResponse", 20 | "Endpoint", 21 | "EndpointSpec", 22 | "EndpointTarget", 23 | "Failure", 24 | "HandlerError", 25 | "Link", 26 | "Request", 27 | "Response", 28 | "StartOperationRequest", 29 | "StartOperationResponse", 30 | "UnsuccessfulOperationError", 31 | ] 32 | -------------------------------------------------------------------------------- /temporalio/api/operatorservice/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/operatorservice/__init__.py -------------------------------------------------------------------------------- /temporalio/api/operatorservice/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .request_response_pb2 import ( 2 | AddOrUpdateRemoteClusterRequest, 3 | AddOrUpdateRemoteClusterResponse, 4 | AddSearchAttributesRequest, 5 | AddSearchAttributesResponse, 6 | ClusterMetadata, 7 | CreateNexusEndpointRequest, 8 | CreateNexusEndpointResponse, 9 | DeleteNamespaceRequest, 10 | DeleteNamespaceResponse, 11 | DeleteNexusEndpointRequest, 12 | DeleteNexusEndpointResponse, 13 | GetNexusEndpointRequest, 14 | GetNexusEndpointResponse, 15 | ListClustersRequest, 16 | ListClustersResponse, 17 | ListNexusEndpointsRequest, 18 | ListNexusEndpointsResponse, 19 | ListSearchAttributesRequest, 20 | ListSearchAttributesResponse, 21 | RemoveRemoteClusterRequest, 22 | RemoveRemoteClusterResponse, 23 | RemoveSearchAttributesRequest, 24 | RemoveSearchAttributesResponse, 25 | UpdateNexusEndpointRequest, 26 | UpdateNexusEndpointResponse, 27 | ) 28 | 29 | __all__ = [ 30 | "AddOrUpdateRemoteClusterRequest", 31 | "AddOrUpdateRemoteClusterResponse", 32 | "AddSearchAttributesRequest", 33 | "AddSearchAttributesResponse", 34 | "ClusterMetadata", 35 | "CreateNexusEndpointRequest", 36 | "CreateNexusEndpointResponse", 37 | "DeleteNamespaceRequest", 38 | "DeleteNamespaceResponse", 39 | "DeleteNexusEndpointRequest", 40 | "DeleteNexusEndpointResponse", 41 | "GetNexusEndpointRequest", 42 | "GetNexusEndpointResponse", 43 | "ListClustersRequest", 44 | "ListClustersResponse", 45 | "ListNexusEndpointsRequest", 46 | "ListNexusEndpointsResponse", 47 | "ListSearchAttributesRequest", 48 | "ListSearchAttributesResponse", 49 | "RemoveRemoteClusterRequest", 50 | "RemoveRemoteClusterResponse", 51 | "RemoveSearchAttributesRequest", 52 | "RemoveSearchAttributesResponse", 53 | "UpdateNexusEndpointRequest", 54 | "UpdateNexusEndpointResponse", 55 | ] 56 | 57 | # gRPC is optional 58 | try: 59 | import grpc 60 | 61 | from .service_pb2_grpc import ( 62 | OperatorServiceServicer, 63 | OperatorServiceStub, 64 | add_OperatorServiceServicer_to_server, 65 | ) 66 | 67 | __all__.extend( 68 | [ 69 | "OperatorServiceServicer", 70 | "OperatorServiceStub", 71 | "add_OperatorServiceServicer_to_server", 72 | ] 73 | ) 74 | except ImportError: 75 | pass 76 | -------------------------------------------------------------------------------- /temporalio/api/operatorservice/v1/request_response_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | 4 | import grpc 5 | -------------------------------------------------------------------------------- /temporalio/api/operatorservice/v1/request_response_pb2_grpc.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | -------------------------------------------------------------------------------- /temporalio/api/operatorservice/v1/service_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import google.protobuf.descriptor 7 | 8 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 9 | -------------------------------------------------------------------------------- /temporalio/api/protocol/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/protocol/__init__.py -------------------------------------------------------------------------------- /temporalio/api/protocol/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import Message 2 | 3 | __all__ = [ 4 | "Message", 5 | ] 6 | -------------------------------------------------------------------------------- /temporalio/api/protocol/v1/message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/protocol/v1/message.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 18 | 19 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 20 | b'\n&temporal/api/protocol/v1/message.proto\x12\x18temporal.api.protocol.v1\x1a\x19google/protobuf/any.proto"\x95\x01\n\x07Message\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1c\n\x14protocol_instance_id\x18\x02 \x01(\t\x12\x12\n\x08\x65vent_id\x18\x03 \x01(\x03H\x00\x12\x17\n\rcommand_index\x18\x04 \x01(\x03H\x00\x12"\n\x04\x62ody\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyB\x0f\n\rsequencing_idB\x93\x01\n\x1bio.temporal.api.protocol.v1B\x0cMessageProtoP\x01Z\'go.temporal.io/api/protocol/v1;protocol\xaa\x02\x1aTemporalio.Api.Protocol.V1\xea\x02\x1dTemporalio::Api::Protocol::V1b\x06proto3' 21 | ) 22 | 23 | 24 | _MESSAGE = DESCRIPTOR.message_types_by_name["Message"] 25 | Message = _reflection.GeneratedProtocolMessageType( 26 | "Message", 27 | (_message.Message,), 28 | { 29 | "DESCRIPTOR": _MESSAGE, 30 | "__module__": "temporal.api.protocol.v1.message_pb2", 31 | # @@protoc_insertion_point(class_scope:temporal.api.protocol.v1.Message) 32 | }, 33 | ) 34 | _sym_db.RegisterMessage(Message) 35 | 36 | if _descriptor._USE_C_DESCRIPTORS == False: 37 | DESCRIPTOR._options = None 38 | DESCRIPTOR._serialized_options = b"\n\033io.temporal.api.protocol.v1B\014MessageProtoP\001Z'go.temporal.io/api/protocol/v1;protocol\252\002\032Temporalio.Api.Protocol.V1\352\002\035Temporalio::Api::Protocol::V1" 39 | _MESSAGE._serialized_start = 96 40 | _MESSAGE._serialized_end = 245 41 | # @@protoc_insertion_point(module_scope) 42 | -------------------------------------------------------------------------------- /temporalio/api/protocol/v1/message_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | 9 | import google.protobuf.any_pb2 10 | import google.protobuf.descriptor 11 | import google.protobuf.message 12 | 13 | if sys.version_info >= (3, 8): 14 | import typing as typing_extensions 15 | else: 16 | import typing_extensions 17 | 18 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 19 | 20 | class Message(google.protobuf.message.Message): 21 | """(-- api-linter: core::0146::any=disabled 22 | aip.dev/not-precedent: We want runtime extensibility for the body field --) 23 | """ 24 | 25 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 26 | 27 | ID_FIELD_NUMBER: builtins.int 28 | PROTOCOL_INSTANCE_ID_FIELD_NUMBER: builtins.int 29 | EVENT_ID_FIELD_NUMBER: builtins.int 30 | COMMAND_INDEX_FIELD_NUMBER: builtins.int 31 | BODY_FIELD_NUMBER: builtins.int 32 | id: builtins.str 33 | """An ID for this specific message.""" 34 | protocol_instance_id: builtins.str 35 | """Identifies the specific instance of a protocol to which this message 36 | belongs. 37 | """ 38 | event_id: builtins.int 39 | command_index: builtins.int 40 | @property 41 | def body(self) -> google.protobuf.any_pb2.Any: 42 | """The opaque data carried by this message. The protocol type can be 43 | extracted from the package name of the message carried inside the Any. 44 | """ 45 | def __init__( 46 | self, 47 | *, 48 | id: builtins.str = ..., 49 | protocol_instance_id: builtins.str = ..., 50 | event_id: builtins.int = ..., 51 | command_index: builtins.int = ..., 52 | body: google.protobuf.any_pb2.Any | None = ..., 53 | ) -> None: ... 54 | def HasField( 55 | self, 56 | field_name: typing_extensions.Literal[ 57 | "body", 58 | b"body", 59 | "command_index", 60 | b"command_index", 61 | "event_id", 62 | b"event_id", 63 | "sequencing_id", 64 | b"sequencing_id", 65 | ], 66 | ) -> builtins.bool: ... 67 | def ClearField( 68 | self, 69 | field_name: typing_extensions.Literal[ 70 | "body", 71 | b"body", 72 | "command_index", 73 | b"command_index", 74 | "event_id", 75 | b"event_id", 76 | "id", 77 | b"id", 78 | "protocol_instance_id", 79 | b"protocol_instance_id", 80 | "sequencing_id", 81 | b"sequencing_id", 82 | ], 83 | ) -> None: ... 84 | def WhichOneof( 85 | self, oneof_group: typing_extensions.Literal["sequencing_id", b"sequencing_id"] 86 | ) -> typing_extensions.Literal["event_id", "command_index"] | None: ... 87 | 88 | global___Message = Message 89 | -------------------------------------------------------------------------------- /temporalio/api/query/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/query/__init__.py -------------------------------------------------------------------------------- /temporalio/api/query/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import QueryRejected, WorkflowQuery, WorkflowQueryResult 2 | 3 | __all__ = [ 4 | "QueryRejected", 5 | "WorkflowQuery", 6 | "WorkflowQueryResult", 7 | ] 8 | -------------------------------------------------------------------------------- /temporalio/api/replication/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/replication/__init__.py -------------------------------------------------------------------------------- /temporalio/api/replication/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | ClusterReplicationConfig, 3 | FailoverStatus, 4 | NamespaceReplicationConfig, 5 | ) 6 | 7 | __all__ = [ 8 | "ClusterReplicationConfig", 9 | "FailoverStatus", 10 | "NamespaceReplicationConfig", 11 | ] 12 | -------------------------------------------------------------------------------- /temporalio/api/replication/v1/message_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import collections.abc 8 | import sys 9 | 10 | import google.protobuf.descriptor 11 | import google.protobuf.internal.containers 12 | import google.protobuf.message 13 | import google.protobuf.timestamp_pb2 14 | 15 | import temporalio.api.enums.v1.namespace_pb2 16 | 17 | if sys.version_info >= (3, 8): 18 | import typing as typing_extensions 19 | else: 20 | import typing_extensions 21 | 22 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 23 | 24 | class ClusterReplicationConfig(google.protobuf.message.Message): 25 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 26 | 27 | CLUSTER_NAME_FIELD_NUMBER: builtins.int 28 | cluster_name: builtins.str 29 | def __init__( 30 | self, 31 | *, 32 | cluster_name: builtins.str = ..., 33 | ) -> None: ... 34 | def ClearField( 35 | self, field_name: typing_extensions.Literal["cluster_name", b"cluster_name"] 36 | ) -> None: ... 37 | 38 | global___ClusterReplicationConfig = ClusterReplicationConfig 39 | 40 | class NamespaceReplicationConfig(google.protobuf.message.Message): 41 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 42 | 43 | ACTIVE_CLUSTER_NAME_FIELD_NUMBER: builtins.int 44 | CLUSTERS_FIELD_NUMBER: builtins.int 45 | STATE_FIELD_NUMBER: builtins.int 46 | active_cluster_name: builtins.str 47 | @property 48 | def clusters( 49 | self, 50 | ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ 51 | global___ClusterReplicationConfig 52 | ]: ... 53 | state: temporalio.api.enums.v1.namespace_pb2.ReplicationState.ValueType 54 | def __init__( 55 | self, 56 | *, 57 | active_cluster_name: builtins.str = ..., 58 | clusters: collections.abc.Iterable[global___ClusterReplicationConfig] 59 | | None = ..., 60 | state: temporalio.api.enums.v1.namespace_pb2.ReplicationState.ValueType = ..., 61 | ) -> None: ... 62 | def ClearField( 63 | self, 64 | field_name: typing_extensions.Literal[ 65 | "active_cluster_name", 66 | b"active_cluster_name", 67 | "clusters", 68 | b"clusters", 69 | "state", 70 | b"state", 71 | ], 72 | ) -> None: ... 73 | 74 | global___NamespaceReplicationConfig = NamespaceReplicationConfig 75 | 76 | class FailoverStatus(google.protobuf.message.Message): 77 | """Represents a historical replication status of a Namespace""" 78 | 79 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 80 | 81 | FAILOVER_TIME_FIELD_NUMBER: builtins.int 82 | FAILOVER_VERSION_FIELD_NUMBER: builtins.int 83 | @property 84 | def failover_time(self) -> google.protobuf.timestamp_pb2.Timestamp: 85 | """Timestamp when the Cluster switched to the following failover_version""" 86 | failover_version: builtins.int 87 | def __init__( 88 | self, 89 | *, 90 | failover_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., 91 | failover_version: builtins.int = ..., 92 | ) -> None: ... 93 | def HasField( 94 | self, field_name: typing_extensions.Literal["failover_time", b"failover_time"] 95 | ) -> builtins.bool: ... 96 | def ClearField( 97 | self, 98 | field_name: typing_extensions.Literal[ 99 | "failover_time", b"failover_time", "failover_version", b"failover_version" 100 | ], 101 | ) -> None: ... 102 | 103 | global___FailoverStatus = FailoverStatus 104 | -------------------------------------------------------------------------------- /temporalio/api/rules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/rules/__init__.py -------------------------------------------------------------------------------- /temporalio/api/rules/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import WorkflowRule, WorkflowRuleAction, WorkflowRuleSpec 2 | 3 | __all__ = [ 4 | "WorkflowRule", 5 | "WorkflowRuleAction", 6 | "WorkflowRuleSpec", 7 | ] 8 | -------------------------------------------------------------------------------- /temporalio/api/schedule/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/schedule/__init__.py -------------------------------------------------------------------------------- /temporalio/api/schedule/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | BackfillRequest, 3 | CalendarSpec, 4 | IntervalSpec, 5 | Range, 6 | Schedule, 7 | ScheduleAction, 8 | ScheduleActionResult, 9 | ScheduleInfo, 10 | ScheduleListEntry, 11 | ScheduleListInfo, 12 | SchedulePatch, 13 | SchedulePolicies, 14 | ScheduleSpec, 15 | ScheduleState, 16 | StructuredCalendarSpec, 17 | TriggerImmediatelyRequest, 18 | ) 19 | 20 | __all__ = [ 21 | "BackfillRequest", 22 | "CalendarSpec", 23 | "IntervalSpec", 24 | "Range", 25 | "Schedule", 26 | "ScheduleAction", 27 | "ScheduleActionResult", 28 | "ScheduleInfo", 29 | "ScheduleListEntry", 30 | "ScheduleListInfo", 31 | "SchedulePatch", 32 | "SchedulePolicies", 33 | "ScheduleSpec", 34 | "ScheduleState", 35 | "StructuredCalendarSpec", 36 | "TriggerImmediatelyRequest", 37 | ] 38 | -------------------------------------------------------------------------------- /temporalio/api/sdk/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/sdk/__init__.py -------------------------------------------------------------------------------- /temporalio/api/sdk/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .enhanced_stack_trace_pb2 import ( 2 | EnhancedStackTrace, 3 | StackTrace, 4 | StackTraceFileLocation, 5 | StackTraceFileSlice, 6 | StackTraceSDKInfo, 7 | ) 8 | from .task_complete_metadata_pb2 import WorkflowTaskCompletedMetadata 9 | from .user_metadata_pb2 import UserMetadata 10 | from .workflow_metadata_pb2 import ( 11 | WorkflowDefinition, 12 | WorkflowInteractionDefinition, 13 | WorkflowMetadata, 14 | ) 15 | 16 | __all__ = [ 17 | "EnhancedStackTrace", 18 | "StackTrace", 19 | "StackTraceFileLocation", 20 | "StackTraceFileSlice", 21 | "StackTraceSDKInfo", 22 | "UserMetadata", 23 | "WorkflowDefinition", 24 | "WorkflowInteractionDefinition", 25 | "WorkflowMetadata", 26 | "WorkflowTaskCompletedMetadata", 27 | ] 28 | -------------------------------------------------------------------------------- /temporalio/api/sdk/v1/task_complete_metadata_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/sdk/v1/task_complete_metadata.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 18 | b'\n0temporal/api/sdk/v1/task_complete_metadata.proto\x12\x13temporal.api.sdk.v1"x\n\x1dWorkflowTaskCompletedMetadata\x12\x17\n\x0f\x63ore_used_flags\x18\x01 \x03(\r\x12\x17\n\x0flang_used_flags\x18\x02 \x03(\r\x12\x10\n\x08sdk_name\x18\x03 \x01(\t\x12\x13\n\x0bsdk_version\x18\x04 \x01(\tB\x87\x01\n\x16io.temporal.api.sdk.v1B\x19TaskCompleteMetadataProtoP\x01Z\x1dgo.temporal.io/api/sdk/v1;sdk\xaa\x02\x15Temporalio.Api.Sdk.V1\xea\x02\x18Temporalio::Api::Sdk::V1b\x06proto3' 19 | ) 20 | 21 | 22 | _WORKFLOWTASKCOMPLETEDMETADATA = DESCRIPTOR.message_types_by_name[ 23 | "WorkflowTaskCompletedMetadata" 24 | ] 25 | WorkflowTaskCompletedMetadata = _reflection.GeneratedProtocolMessageType( 26 | "WorkflowTaskCompletedMetadata", 27 | (_message.Message,), 28 | { 29 | "DESCRIPTOR": _WORKFLOWTASKCOMPLETEDMETADATA, 30 | "__module__": "temporal.api.sdk.v1.task_complete_metadata_pb2", 31 | # @@protoc_insertion_point(class_scope:temporal.api.sdk.v1.WorkflowTaskCompletedMetadata) 32 | }, 33 | ) 34 | _sym_db.RegisterMessage(WorkflowTaskCompletedMetadata) 35 | 36 | if _descriptor._USE_C_DESCRIPTORS == False: 37 | DESCRIPTOR._options = None 38 | DESCRIPTOR._serialized_options = b"\n\026io.temporal.api.sdk.v1B\031TaskCompleteMetadataProtoP\001Z\035go.temporal.io/api/sdk/v1;sdk\252\002\025Temporalio.Api.Sdk.V1\352\002\030Temporalio::Api::Sdk::V1" 39 | _WORKFLOWTASKCOMPLETEDMETADATA._serialized_start = 73 40 | _WORKFLOWTASKCOMPLETEDMETADATA._serialized_end = 193 41 | # @@protoc_insertion_point(module_scope) 42 | -------------------------------------------------------------------------------- /temporalio/api/sdk/v1/user_metadata_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/sdk/v1/user_metadata.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from temporalio.api.common.v1 import ( 18 | message_pb2 as temporal_dot_api_dot_common_dot_v1_dot_message__pb2, 19 | ) 20 | 21 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 22 | b"\n'temporal/api/sdk/v1/user_metadata.proto\x12\x13temporal.api.sdk.v1\x1a$temporal/api/common/v1/message.proto\"r\n\x0cUserMetadata\x12\x30\n\x07summary\x18\x01 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x30\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.PayloadB\x7f\n\x16io.temporal.api.sdk.v1B\x11UserMetadataProtoP\x01Z\x1dgo.temporal.io/api/sdk/v1;sdk\xaa\x02\x15Temporalio.Api.Sdk.V1\xea\x02\x18Temporalio::Api::Sdk::V1b\x06proto3" 23 | ) 24 | 25 | 26 | _USERMETADATA = DESCRIPTOR.message_types_by_name["UserMetadata"] 27 | UserMetadata = _reflection.GeneratedProtocolMessageType( 28 | "UserMetadata", 29 | (_message.Message,), 30 | { 31 | "DESCRIPTOR": _USERMETADATA, 32 | "__module__": "temporal.api.sdk.v1.user_metadata_pb2", 33 | # @@protoc_insertion_point(class_scope:temporal.api.sdk.v1.UserMetadata) 34 | }, 35 | ) 36 | _sym_db.RegisterMessage(UserMetadata) 37 | 38 | if _descriptor._USE_C_DESCRIPTORS == False: 39 | DESCRIPTOR._options = None 40 | DESCRIPTOR._serialized_options = b"\n\026io.temporal.api.sdk.v1B\021UserMetadataProtoP\001Z\035go.temporal.io/api/sdk/v1;sdk\252\002\025Temporalio.Api.Sdk.V1\352\002\030Temporalio::Api::Sdk::V1" 41 | _USERMETADATA._serialized_start = 102 42 | _USERMETADATA._serialized_end = 216 43 | # @@protoc_insertion_point(module_scope) 44 | -------------------------------------------------------------------------------- /temporalio/api/sdk/v1/user_metadata_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | 9 | import google.protobuf.descriptor 10 | import google.protobuf.message 11 | 12 | import temporalio.api.common.v1.message_pb2 13 | 14 | if sys.version_info >= (3, 8): 15 | import typing as typing_extensions 16 | else: 17 | import typing_extensions 18 | 19 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 20 | 21 | class UserMetadata(google.protobuf.message.Message): 22 | """Information a user can set, often for use by user interfaces.""" 23 | 24 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 25 | 26 | SUMMARY_FIELD_NUMBER: builtins.int 27 | DETAILS_FIELD_NUMBER: builtins.int 28 | @property 29 | def summary(self) -> temporalio.api.common.v1.message_pb2.Payload: 30 | """Short-form text that provides a summary. This payload should be a "json/plain"-encoded payload 31 | that is a single JSON string for use in user interfaces. User interface formatting may not 32 | apply to this text when used in "title" situations. The payload data section is limited to 400 33 | bytes by default. 34 | """ 35 | @property 36 | def details(self) -> temporalio.api.common.v1.message_pb2.Payload: 37 | """Long-form text that provides details. This payload should be a "json/plain"-encoded payload 38 | that is a single JSON string for use in user interfaces. User interface formatting may apply to 39 | this text in common use. The payload data section is limited to 20000 bytes by default. 40 | """ 41 | def __init__( 42 | self, 43 | *, 44 | summary: temporalio.api.common.v1.message_pb2.Payload | None = ..., 45 | details: temporalio.api.common.v1.message_pb2.Payload | None = ..., 46 | ) -> None: ... 47 | def HasField( 48 | self, 49 | field_name: typing_extensions.Literal[ 50 | "details", b"details", "summary", b"summary" 51 | ], 52 | ) -> builtins.bool: ... 53 | def ClearField( 54 | self, 55 | field_name: typing_extensions.Literal[ 56 | "details", b"details", "summary", b"summary" 57 | ], 58 | ) -> None: ... 59 | 60 | global___UserMetadata = UserMetadata 61 | -------------------------------------------------------------------------------- /temporalio/api/taskqueue/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/taskqueue/__init__.py -------------------------------------------------------------------------------- /temporalio/api/taskqueue/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | BuildIdAssignmentRule, 3 | BuildIdReachability, 4 | CompatibleBuildIdRedirectRule, 5 | CompatibleVersionSet, 6 | PollerInfo, 7 | PollerScalingDecision, 8 | RampByPercentage, 9 | StickyExecutionAttributes, 10 | TaskIdBlock, 11 | TaskQueue, 12 | TaskQueueMetadata, 13 | TaskQueuePartitionMetadata, 14 | TaskQueueReachability, 15 | TaskQueueStats, 16 | TaskQueueStatus, 17 | TaskQueueTypeInfo, 18 | TaskQueueVersionInfo, 19 | TaskQueueVersioningInfo, 20 | TaskQueueVersionSelection, 21 | TimestampedBuildIdAssignmentRule, 22 | TimestampedCompatibleBuildIdRedirectRule, 23 | ) 24 | 25 | __all__ = [ 26 | "BuildIdAssignmentRule", 27 | "BuildIdReachability", 28 | "CompatibleBuildIdRedirectRule", 29 | "CompatibleVersionSet", 30 | "PollerInfo", 31 | "PollerScalingDecision", 32 | "RampByPercentage", 33 | "StickyExecutionAttributes", 34 | "TaskIdBlock", 35 | "TaskQueue", 36 | "TaskQueueMetadata", 37 | "TaskQueuePartitionMetadata", 38 | "TaskQueueReachability", 39 | "TaskQueueStats", 40 | "TaskQueueStatus", 41 | "TaskQueueTypeInfo", 42 | "TaskQueueVersionInfo", 43 | "TaskQueueVersionSelection", 44 | "TaskQueueVersioningInfo", 45 | "TimestampedBuildIdAssignmentRule", 46 | "TimestampedCompatibleBuildIdRedirectRule", 47 | ] 48 | -------------------------------------------------------------------------------- /temporalio/api/testservice/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/testservice/__init__.py -------------------------------------------------------------------------------- /temporalio/api/testservice/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .request_response_pb2 import ( 2 | GetCurrentTimeResponse, 3 | LockTimeSkippingRequest, 4 | LockTimeSkippingResponse, 5 | SleepRequest, 6 | SleepResponse, 7 | SleepUntilRequest, 8 | UnlockTimeSkippingRequest, 9 | UnlockTimeSkippingResponse, 10 | ) 11 | 12 | __all__ = [ 13 | "GetCurrentTimeResponse", 14 | "LockTimeSkippingRequest", 15 | "LockTimeSkippingResponse", 16 | "SleepRequest", 17 | "SleepResponse", 18 | "SleepUntilRequest", 19 | "UnlockTimeSkippingRequest", 20 | "UnlockTimeSkippingResponse", 21 | ] 22 | 23 | # gRPC is optional 24 | try: 25 | import grpc 26 | 27 | from .service_pb2_grpc import ( 28 | TestServiceServicer, 29 | TestServiceStub, 30 | add_TestServiceServicer_to_server, 31 | ) 32 | 33 | __all__.extend( 34 | ["TestServiceServicer", "TestServiceStub", "add_TestServiceServicer_to_server"] 35 | ) 36 | except ImportError: 37 | pass 38 | -------------------------------------------------------------------------------- /temporalio/api/testservice/v1/request_response_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | 4 | import grpc 5 | -------------------------------------------------------------------------------- /temporalio/api/testservice/v1/request_response_pb2_grpc.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | The MIT License 5 | 6 | Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | """ 26 | -------------------------------------------------------------------------------- /temporalio/api/testservice/v1/service_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/api/testservice/v1/service.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 18 | 19 | from temporalio.api.testservice.v1 import ( 20 | request_response_pb2 as temporal_dot_api_dot_testservice_dot_v1_dot_request__response__pb2, 21 | ) 22 | 23 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 24 | b'\n)temporal/api/testservice/v1/service.proto\x12\x1btemporal.api.testservice.v1\x1a\x32temporal/api/testservice/v1/request_response.proto\x1a\x1bgoogle/protobuf/empty.proto2\xc2\x05\n\x0bTestService\x12\x81\x01\n\x10LockTimeSkipping\x12\x34.temporal.api.testservice.v1.LockTimeSkippingRequest\x1a\x35.temporal.api.testservice.v1.LockTimeSkippingResponse"\x00\x12\x87\x01\n\x12UnlockTimeSkipping\x12\x36.temporal.api.testservice.v1.UnlockTimeSkippingRequest\x1a\x37.temporal.api.testservice.v1.UnlockTimeSkippingResponse"\x00\x12`\n\x05Sleep\x12).temporal.api.testservice.v1.SleepRequest\x1a*.temporal.api.testservice.v1.SleepResponse"\x00\x12j\n\nSleepUntil\x12..temporal.api.testservice.v1.SleepUntilRequest\x1a*.temporal.api.testservice.v1.SleepResponse"\x00\x12v\n\x1bUnlockTimeSkippingWithSleep\x12).temporal.api.testservice.v1.SleepRequest\x1a*.temporal.api.testservice.v1.SleepResponse"\x00\x12_\n\x0eGetCurrentTime\x12\x16.google.protobuf.Empty\x1a\x33.temporal.api.testservice.v1.GetCurrentTimeResponse"\x00\x42\xa2\x01\n\x1eio.temporal.api.testservice.v1B\x0cServiceProtoP\x01Z-go.temporal.io/api/testservice/v1;testservice\xaa\x02\x1dTemporalio.Api.TestService.V1\xea\x02 Temporalio::Api::TestService::V1b\x06proto3' 25 | ) 26 | 27 | 28 | _TESTSERVICE = DESCRIPTOR.services_by_name["TestService"] 29 | if _descriptor._USE_C_DESCRIPTORS == False: 30 | DESCRIPTOR._options = None 31 | DESCRIPTOR._serialized_options = b"\n\036io.temporal.api.testservice.v1B\014ServiceProtoP\001Z-go.temporal.io/api/testservice/v1;testservice\252\002\035Temporalio.Api.TestService.V1\352\002 Temporalio::Api::TestService::V1" 32 | _TESTSERVICE._serialized_start = 156 33 | _TESTSERVICE._serialized_end = 862 34 | # @@protoc_insertion_point(module_scope) 35 | -------------------------------------------------------------------------------- /temporalio/api/testservice/v1/service_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | The MIT License 5 | 6 | Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | """ 26 | 27 | import google.protobuf.descriptor 28 | 29 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 30 | -------------------------------------------------------------------------------- /temporalio/api/update/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/update/__init__.py -------------------------------------------------------------------------------- /temporalio/api/update/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | Acceptance, 3 | Input, 4 | Meta, 5 | Outcome, 6 | Rejection, 7 | Request, 8 | Response, 9 | UpdateRef, 10 | WaitPolicy, 11 | ) 12 | 13 | __all__ = [ 14 | "Acceptance", 15 | "Input", 16 | "Meta", 17 | "Outcome", 18 | "Rejection", 19 | "Request", 20 | "Response", 21 | "UpdateRef", 22 | "WaitPolicy", 23 | ] 24 | -------------------------------------------------------------------------------- /temporalio/api/version/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/version/__init__.py -------------------------------------------------------------------------------- /temporalio/api/version/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import Alert, ReleaseInfo, VersionInfo 2 | 3 | __all__ = [ 4 | "Alert", 5 | "ReleaseInfo", 6 | "VersionInfo", 7 | ] 8 | -------------------------------------------------------------------------------- /temporalio/api/workflow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/workflow/__init__.py -------------------------------------------------------------------------------- /temporalio/api/workflow/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .message_pb2 import ( 2 | CallbackInfo, 3 | DeploymentTransition, 4 | DeploymentVersionTransition, 5 | NewWorkflowExecutionInfo, 6 | NexusOperationCancellationInfo, 7 | OnConflictOptions, 8 | PendingActivityInfo, 9 | PendingChildExecutionInfo, 10 | PendingNexusOperationInfo, 11 | PendingWorkflowTaskInfo, 12 | PostResetOperation, 13 | RequestIdInfo, 14 | ResetPointInfo, 15 | ResetPoints, 16 | VersioningOverride, 17 | WorkflowExecutionConfig, 18 | WorkflowExecutionExtendedInfo, 19 | WorkflowExecutionInfo, 20 | WorkflowExecutionOptions, 21 | WorkflowExecutionVersioningInfo, 22 | ) 23 | 24 | __all__ = [ 25 | "CallbackInfo", 26 | "DeploymentTransition", 27 | "DeploymentVersionTransition", 28 | "NewWorkflowExecutionInfo", 29 | "NexusOperationCancellationInfo", 30 | "OnConflictOptions", 31 | "PendingActivityInfo", 32 | "PendingChildExecutionInfo", 33 | "PendingNexusOperationInfo", 34 | "PendingWorkflowTaskInfo", 35 | "PostResetOperation", 36 | "RequestIdInfo", 37 | "ResetPointInfo", 38 | "ResetPoints", 39 | "VersioningOverride", 40 | "WorkflowExecutionConfig", 41 | "WorkflowExecutionExtendedInfo", 42 | "WorkflowExecutionInfo", 43 | "WorkflowExecutionOptions", 44 | "WorkflowExecutionVersioningInfo", 45 | ] 46 | -------------------------------------------------------------------------------- /temporalio/api/workflowservice/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/api/workflowservice/__init__.py -------------------------------------------------------------------------------- /temporalio/api/workflowservice/v1/request_response_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | 4 | import grpc 5 | -------------------------------------------------------------------------------- /temporalio/api/workflowservice/v1/request_response_pb2_grpc.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | -------------------------------------------------------------------------------- /temporalio/api/workflowservice/v1/service_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import google.protobuf.descriptor 7 | 8 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 9 | -------------------------------------------------------------------------------- /temporalio/bridge/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "temporal-sdk-bridge" 3 | version = "0.1.0" 4 | edition = "2021" 5 | description = "Python sdk-core bridge" 6 | license = "MIT" 7 | repository = "https://github.com/temporalio/sdk-python" 8 | documentation = "https://docs.temporal.io/dev-guide/python" 9 | 10 | [package.metadata.maturin] 11 | module-name = "temporalio.bridge.temporal_sdk_bridge" 12 | 13 | 14 | [lib] 15 | name = "temporal_sdk_bridge" 16 | crate-type = ["cdylib"] 17 | 18 | [dependencies] 19 | anyhow = "1.0" 20 | async-trait = "0.1" 21 | futures = "0.3" 22 | log = "0.4" 23 | prost = "0.13" 24 | pyo3 = { version = "0.25", features = ["extension-module", "abi3-py39", "anyhow"] } 25 | pyo3-async-runtimes = { version = "0.25", features = ["tokio-runtime"] } 26 | pythonize = "0.25" 27 | temporal-client = { version = "0.1.0", path = "./sdk-core/client" } 28 | temporal-sdk-core = { version = "0.1.0", path = "./sdk-core/core", features = ["ephemeral-server"] } 29 | temporal-sdk-core-api = { version = "0.1.0", path = "./sdk-core/core-api", features = ["envconfig"] } 30 | temporal-sdk-core-protos = { version = "0.1.0", path = "./sdk-core/sdk-core-protos" } 31 | tokio = "1.26" 32 | tokio-stream = "0.1" 33 | tonic = "0.12" 34 | tracing = "0.1" 35 | url = "2.2" 36 | 37 | [profile.release] 38 | opt-level = 3 39 | debug = false 40 | lto = true 41 | incremental = false 42 | -------------------------------------------------------------------------------- /temporalio/bridge/__init__.py: -------------------------------------------------------------------------------- 1 | """Python interface to SDK Core. (unstable) 2 | 3 | Nothing in this package should be considered stable. The API may change. 4 | """ 5 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/__init__.py: -------------------------------------------------------------------------------- 1 | from .core_interface_pb2 import ( 2 | ActivityHeartbeat, 3 | ActivitySlotInfo, 4 | ActivityTaskCompletion, 5 | LocalActivitySlotInfo, 6 | NexusSlotInfo, 7 | WorkflowSlotInfo, 8 | ) 9 | 10 | __all__ = [ 11 | "ActivityHeartbeat", 12 | "ActivitySlotInfo", 13 | "ActivityTaskCompletion", 14 | "LocalActivitySlotInfo", 15 | "NexusSlotInfo", 16 | "WorkflowSlotInfo", 17 | ] 18 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/activity_result/__init__.py: -------------------------------------------------------------------------------- 1 | from .activity_result_pb2 import ( 2 | ActivityExecutionResult, 3 | ActivityResolution, 4 | Cancellation, 5 | DoBackoff, 6 | Failure, 7 | Success, 8 | WillCompleteAsync, 9 | ) 10 | 11 | __all__ = [ 12 | "ActivityExecutionResult", 13 | "ActivityResolution", 14 | "Cancellation", 15 | "DoBackoff", 16 | "Failure", 17 | "Success", 18 | "WillCompleteAsync", 19 | ] 20 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/activity_task/__init__.py: -------------------------------------------------------------------------------- 1 | from .activity_task_pb2 import ( 2 | ActivityCancellationDetails, 3 | ActivityCancelReason, 4 | ActivityTask, 5 | Cancel, 6 | Start, 7 | ) 8 | 9 | __all__ = [ 10 | "ActivityCancelReason", 11 | "ActivityCancellationDetails", 12 | "ActivityTask", 13 | "Cancel", 14 | "Start", 15 | ] 16 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/bridge/__init__.py: -------------------------------------------------------------------------------- 1 | from .bridge_pb2 import ( 2 | CompleteActivityTaskRequest, 3 | CompleteActivityTaskResponse, 4 | CompleteWorkflowActivationRequest, 5 | CompleteWorkflowActivationResponse, 6 | CreateClientRequest, 7 | CreateWorkerRequest, 8 | FetchBufferedLogsRequest, 9 | FetchBufferedLogsResponse, 10 | InitResponse, 11 | InitTelemetryRequest, 12 | LogLevel, 13 | PollActivityTaskRequest, 14 | PollActivityTaskResponse, 15 | PollWorkflowActivationRequest, 16 | PollWorkflowActivationResponse, 17 | RecordActivityHeartbeatRequest, 18 | RecordActivityHeartbeatResponse, 19 | RegisterWorkerResponse, 20 | RequestWorkflowEvictionRequest, 21 | RequestWorkflowEvictionResponse, 22 | ShutdownWorkerRequest, 23 | ShutdownWorkerResponse, 24 | ) 25 | 26 | __all__ = [ 27 | "CompleteActivityTaskRequest", 28 | "CompleteActivityTaskResponse", 29 | "CompleteWorkflowActivationRequest", 30 | "CompleteWorkflowActivationResponse", 31 | "CreateClientRequest", 32 | "CreateWorkerRequest", 33 | "FetchBufferedLogsRequest", 34 | "FetchBufferedLogsResponse", 35 | "InitResponse", 36 | "InitTelemetryRequest", 37 | "LogLevel", 38 | "PollActivityTaskRequest", 39 | "PollActivityTaskResponse", 40 | "PollWorkflowActivationRequest", 41 | "PollWorkflowActivationResponse", 42 | "RecordActivityHeartbeatRequest", 43 | "RecordActivityHeartbeatResponse", 44 | "RegisterWorkerResponse", 45 | "RequestWorkflowEvictionRequest", 46 | "RequestWorkflowEvictionResponse", 47 | "ShutdownWorkerRequest", 48 | "ShutdownWorkerResponse", 49 | ] 50 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/child_workflow/__init__.py: -------------------------------------------------------------------------------- 1 | from .child_workflow_pb2 import ( 2 | Cancellation, 3 | ChildWorkflowCancellationType, 4 | ChildWorkflowResult, 5 | Failure, 6 | ParentClosePolicy, 7 | StartChildWorkflowExecutionFailedCause, 8 | Success, 9 | ) 10 | 11 | __all__ = [ 12 | "Cancellation", 13 | "ChildWorkflowCancellationType", 14 | "ChildWorkflowResult", 15 | "Failure", 16 | "ParentClosePolicy", 17 | "StartChildWorkflowExecutionFailedCause", 18 | "Success", 19 | ] 20 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/common/__init__.py: -------------------------------------------------------------------------------- 1 | from .common_pb2 import ( 2 | NamespacedWorkflowExecution, 3 | VersioningIntent, 4 | WorkerDeploymentVersion, 5 | ) 6 | 7 | __all__ = [ 8 | "NamespacedWorkflowExecution", 9 | "VersioningIntent", 10 | "WorkerDeploymentVersion", 11 | ] 12 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/common/common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/sdk/core/common/common.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | from google.protobuf.internal import enum_type_wrapper 12 | 13 | # @@protoc_insertion_point(imports) 14 | 15 | _sym_db = _symbol_database.Default() 16 | 17 | 18 | from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 19 | 20 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 21 | b'\n%temporal/sdk/core/common/common.proto\x12\x0e\x63oresdk.common\x1a\x1egoogle/protobuf/duration.proto"U\n\x1bNamespacedWorkflowExecution\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\t"D\n\x17WorkerDeploymentVersion\x12\x17\n\x0f\x64\x65ployment_name\x18\x01 \x01(\t\x12\x10\n\x08\x62uild_id\x18\x02 \x01(\t*@\n\x10VersioningIntent\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0e\n\nCOMPATIBLE\x10\x01\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x02\x42,\xea\x02)Temporalio::Internal::Bridge::Api::Commonb\x06proto3' 22 | ) 23 | 24 | _VERSIONINGINTENT = DESCRIPTOR.enum_types_by_name["VersioningIntent"] 25 | VersioningIntent = enum_type_wrapper.EnumTypeWrapper(_VERSIONINGINTENT) 26 | UNSPECIFIED = 0 27 | COMPATIBLE = 1 28 | DEFAULT = 2 29 | 30 | 31 | _NAMESPACEDWORKFLOWEXECUTION = DESCRIPTOR.message_types_by_name[ 32 | "NamespacedWorkflowExecution" 33 | ] 34 | _WORKERDEPLOYMENTVERSION = DESCRIPTOR.message_types_by_name["WorkerDeploymentVersion"] 35 | NamespacedWorkflowExecution = _reflection.GeneratedProtocolMessageType( 36 | "NamespacedWorkflowExecution", 37 | (_message.Message,), 38 | { 39 | "DESCRIPTOR": _NAMESPACEDWORKFLOWEXECUTION, 40 | "__module__": "temporal.sdk.core.common.common_pb2", 41 | # @@protoc_insertion_point(class_scope:coresdk.common.NamespacedWorkflowExecution) 42 | }, 43 | ) 44 | _sym_db.RegisterMessage(NamespacedWorkflowExecution) 45 | 46 | WorkerDeploymentVersion = _reflection.GeneratedProtocolMessageType( 47 | "WorkerDeploymentVersion", 48 | (_message.Message,), 49 | { 50 | "DESCRIPTOR": _WORKERDEPLOYMENTVERSION, 51 | "__module__": "temporal.sdk.core.common.common_pb2", 52 | # @@protoc_insertion_point(class_scope:coresdk.common.WorkerDeploymentVersion) 53 | }, 54 | ) 55 | _sym_db.RegisterMessage(WorkerDeploymentVersion) 56 | 57 | if _descriptor._USE_C_DESCRIPTORS == False: 58 | DESCRIPTOR._options = None 59 | DESCRIPTOR._serialized_options = ( 60 | b"\352\002)Temporalio::Internal::Bridge::Api::Common" 61 | ) 62 | _VERSIONINGINTENT._serialized_start = 246 63 | _VERSIONINGINTENT._serialized_end = 310 64 | _NAMESPACEDWORKFLOWEXECUTION._serialized_start = 89 65 | _NAMESPACEDWORKFLOWEXECUTION._serialized_end = 174 66 | _WORKERDEPLOYMENTVERSION._serialized_start = 176 67 | _WORKERDEPLOYMENTVERSION._serialized_end = 244 68 | # @@protoc_insertion_point(module_scope) 69 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/core_interface_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | """Client and server classes corresponding to protobuf-defined services.""" 3 | 4 | import grpc 5 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/core_interface_pb2_grpc.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/external_data/__init__.py: -------------------------------------------------------------------------------- 1 | from .external_data_pb2 import LocalActivityMarkerData, PatchedMarkerData 2 | 3 | __all__ = [ 4 | "LocalActivityMarkerData", 5 | "PatchedMarkerData", 6 | ] 7 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/external_data/external_data_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: temporal/sdk/core/external_data/external_data.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 18 | from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 19 | 20 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 21 | b'\n3temporal/sdk/core/external_data/external_data.proto\x12\x15\x63oresdk.external_data\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xfe\x01\n\x17LocalActivityMarkerData\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x0f\n\x07\x61ttempt\x18\x02 \x01(\r\x12\x13\n\x0b\x61\x63tivity_id\x18\x03 \x01(\t\x12\x15\n\ractivity_type\x18\x04 \x01(\t\x12\x31\n\rcomplete_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12*\n\x07\x62\x61\x63koff\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12:\n\x16original_schedule_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"3\n\x11PatchedMarkerData\x12\n\n\x02id\x18\x01 \x01(\t\x12\x12\n\ndeprecated\x18\x02 \x01(\x08\x42\x32\xea\x02/Temporalio::Internal::Bridge::Api::ExternalDatab\x06proto3' 22 | ) 23 | 24 | 25 | _LOCALACTIVITYMARKERDATA = DESCRIPTOR.message_types_by_name["LocalActivityMarkerData"] 26 | _PATCHEDMARKERDATA = DESCRIPTOR.message_types_by_name["PatchedMarkerData"] 27 | LocalActivityMarkerData = _reflection.GeneratedProtocolMessageType( 28 | "LocalActivityMarkerData", 29 | (_message.Message,), 30 | { 31 | "DESCRIPTOR": _LOCALACTIVITYMARKERDATA, 32 | "__module__": "temporal.sdk.core.external_data.external_data_pb2", 33 | # @@protoc_insertion_point(class_scope:coresdk.external_data.LocalActivityMarkerData) 34 | }, 35 | ) 36 | _sym_db.RegisterMessage(LocalActivityMarkerData) 37 | 38 | PatchedMarkerData = _reflection.GeneratedProtocolMessageType( 39 | "PatchedMarkerData", 40 | (_message.Message,), 41 | { 42 | "DESCRIPTOR": _PATCHEDMARKERDATA, 43 | "__module__": "temporal.sdk.core.external_data.external_data_pb2", 44 | # @@protoc_insertion_point(class_scope:coresdk.external_data.PatchedMarkerData) 45 | }, 46 | ) 47 | _sym_db.RegisterMessage(PatchedMarkerData) 48 | 49 | if _descriptor._USE_C_DESCRIPTORS == False: 50 | DESCRIPTOR._options = None 51 | DESCRIPTOR._serialized_options = ( 52 | b"\352\002/Temporalio::Internal::Bridge::Api::ExternalData" 53 | ) 54 | _LOCALACTIVITYMARKERDATA._serialized_start = 144 55 | _LOCALACTIVITYMARKERDATA._serialized_end = 398 56 | _PATCHEDMARKERDATA._serialized_start = 400 57 | _PATCHEDMARKERDATA._serialized_end = 451 58 | # @@protoc_insertion_point(module_scope) 59 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/health/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/bridge/proto/health/__init__.py -------------------------------------------------------------------------------- /temporalio/bridge/proto/health/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from .health_pb2 import HealthCheckRequest, HealthCheckResponse 2 | 3 | __all__ = [ 4 | "HealthCheckRequest", 5 | "HealthCheckResponse", 6 | ] 7 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/health/v1/health_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: health/v1/health.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 18 | b'\n\x16health/v1/health.proto\x12\x17temporal.grpc.health.v1"%\n\x12HealthCheckRequest\x12\x0f\n\x07service\x18\x01 \x01(\t"\xb2\x01\n\x13HealthCheckResponse\x12J\n\x06status\x18\x01 \x01(\x0e\x32:.temporal.grpc.health.v1.HealthCheckResponse.ServingStatus"O\n\rServingStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVING\x10\x01\x12\x0f\n\x0bNOT_SERVING\x10\x02\x12\x13\n\x0fSERVICE_UNKNOWN\x10\x03\x32\xd2\x01\n\x06Health\x12\x62\n\x05\x43heck\x12+.temporal.grpc.health.v1.HealthCheckRequest\x1a,.temporal.grpc.health.v1.HealthCheckResponse\x12\x64\n\x05Watch\x12+.temporal.grpc.health.v1.HealthCheckRequest\x1a,.temporal.grpc.health.v1.HealthCheckResponse0\x01\x42\x61\n\x11io.grpc.health.v1B\x0bHealthProtoP\x01Z,google.golang.org/grpc/health/grpc_health_v1\xaa\x02\x0eGrpc.Health.V1b\x06proto3' 19 | ) 20 | 21 | 22 | _HEALTHCHECKREQUEST = DESCRIPTOR.message_types_by_name["HealthCheckRequest"] 23 | _HEALTHCHECKRESPONSE = DESCRIPTOR.message_types_by_name["HealthCheckResponse"] 24 | _HEALTHCHECKRESPONSE_SERVINGSTATUS = _HEALTHCHECKRESPONSE.enum_types_by_name[ 25 | "ServingStatus" 26 | ] 27 | HealthCheckRequest = _reflection.GeneratedProtocolMessageType( 28 | "HealthCheckRequest", 29 | (_message.Message,), 30 | { 31 | "DESCRIPTOR": _HEALTHCHECKREQUEST, 32 | "__module__": "health.v1.health_pb2", 33 | # @@protoc_insertion_point(class_scope:temporal.grpc.health.v1.HealthCheckRequest) 34 | }, 35 | ) 36 | _sym_db.RegisterMessage(HealthCheckRequest) 37 | 38 | HealthCheckResponse = _reflection.GeneratedProtocolMessageType( 39 | "HealthCheckResponse", 40 | (_message.Message,), 41 | { 42 | "DESCRIPTOR": _HEALTHCHECKRESPONSE, 43 | "__module__": "health.v1.health_pb2", 44 | # @@protoc_insertion_point(class_scope:temporal.grpc.health.v1.HealthCheckResponse) 45 | }, 46 | ) 47 | _sym_db.RegisterMessage(HealthCheckResponse) 48 | 49 | _HEALTH = DESCRIPTOR.services_by_name["Health"] 50 | if _descriptor._USE_C_DESCRIPTORS == False: 51 | DESCRIPTOR._options = None 52 | DESCRIPTOR._serialized_options = b"\n\021io.grpc.health.v1B\013HealthProtoP\001Z,google.golang.org/grpc/health/grpc_health_v1\252\002\016Grpc.Health.V1" 53 | _HEALTHCHECKREQUEST._serialized_start = 51 54 | _HEALTHCHECKREQUEST._serialized_end = 88 55 | _HEALTHCHECKRESPONSE._serialized_start = 91 56 | _HEALTHCHECKRESPONSE._serialized_end = 269 57 | _HEALTHCHECKRESPONSE_SERVINGSTATUS._serialized_start = 190 58 | _HEALTHCHECKRESPONSE_SERVINGSTATUS._serialized_end = 269 59 | _HEALTH._serialized_start = 272 60 | _HEALTH._serialized_end = 482 61 | # @@protoc_insertion_point(module_scope) 62 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/health/v1/health_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | We have to alter this to prevent gRPC health clash""" 5 | 6 | import builtins 7 | import sys 8 | import typing 9 | 10 | import google.protobuf.descriptor 11 | import google.protobuf.internal.enum_type_wrapper 12 | import google.protobuf.message 13 | 14 | if sys.version_info >= (3, 10): 15 | import typing as typing_extensions 16 | else: 17 | import typing_extensions 18 | 19 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 20 | 21 | class HealthCheckRequest(google.protobuf.message.Message): 22 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 23 | 24 | SERVICE_FIELD_NUMBER: builtins.int 25 | service: builtins.str 26 | def __init__( 27 | self, 28 | *, 29 | service: builtins.str = ..., 30 | ) -> None: ... 31 | def ClearField( 32 | self, field_name: typing_extensions.Literal["service", b"service"] 33 | ) -> None: ... 34 | 35 | global___HealthCheckRequest = HealthCheckRequest 36 | 37 | class HealthCheckResponse(google.protobuf.message.Message): 38 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 39 | 40 | class _ServingStatus: 41 | ValueType = typing.NewType("ValueType", builtins.int) 42 | V: typing_extensions.TypeAlias = ValueType 43 | 44 | class _ServingStatusEnumTypeWrapper( 45 | google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ 46 | HealthCheckResponse._ServingStatus.ValueType 47 | ], 48 | builtins.type, 49 | ): # noqa: F821 50 | DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor 51 | UNKNOWN: HealthCheckResponse._ServingStatus.ValueType # 0 52 | SERVING: HealthCheckResponse._ServingStatus.ValueType # 1 53 | NOT_SERVING: HealthCheckResponse._ServingStatus.ValueType # 2 54 | SERVICE_UNKNOWN: HealthCheckResponse._ServingStatus.ValueType # 3 55 | """Used only by the Watch method.""" 56 | 57 | class ServingStatus(_ServingStatus, metaclass=_ServingStatusEnumTypeWrapper): ... 58 | UNKNOWN: HealthCheckResponse.ServingStatus.ValueType # 0 59 | SERVING: HealthCheckResponse.ServingStatus.ValueType # 1 60 | NOT_SERVING: HealthCheckResponse.ServingStatus.ValueType # 2 61 | SERVICE_UNKNOWN: HealthCheckResponse.ServingStatus.ValueType # 3 62 | """Used only by the Watch method.""" 63 | 64 | STATUS_FIELD_NUMBER: builtins.int 65 | status: global___HealthCheckResponse.ServingStatus.ValueType 66 | def __init__( 67 | self, 68 | *, 69 | status: global___HealthCheckResponse.ServingStatus.ValueType = ..., 70 | ) -> None: ... 71 | def ClearField( 72 | self, field_name: typing_extensions.Literal["status", b"status"] 73 | ) -> None: ... 74 | 75 | global___HealthCheckResponse = HealthCheckResponse 76 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/nexus/__init__.py: -------------------------------------------------------------------------------- 1 | from .nexus_pb2 import ( 2 | CancelNexusTask, 3 | NexusOperationCancellationType, 4 | NexusOperationResult, 5 | NexusTask, 6 | NexusTaskCancelReason, 7 | NexusTaskCompletion, 8 | ) 9 | 10 | __all__ = [ 11 | "CancelNexusTask", 12 | "NexusOperationCancellationType", 13 | "NexusOperationResult", 14 | "NexusTask", 15 | "NexusTaskCancelReason", 16 | "NexusTaskCompletion", 17 | ] 18 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/workflow_activation/__init__.py: -------------------------------------------------------------------------------- 1 | from .workflow_activation_pb2 import ( 2 | CancelWorkflow, 3 | DoUpdate, 4 | FireTimer, 5 | InitializeWorkflow, 6 | NotifyHasPatch, 7 | QueryWorkflow, 8 | RemoveFromCache, 9 | ResolveActivity, 10 | ResolveChildWorkflowExecution, 11 | ResolveChildWorkflowExecutionStart, 12 | ResolveChildWorkflowExecutionStartCancelled, 13 | ResolveChildWorkflowExecutionStartFailure, 14 | ResolveChildWorkflowExecutionStartSuccess, 15 | ResolveNexusOperation, 16 | ResolveNexusOperationStart, 17 | ResolveRequestCancelExternalWorkflow, 18 | ResolveSignalExternalWorkflow, 19 | SignalWorkflow, 20 | UpdateRandomSeed, 21 | WorkflowActivation, 22 | WorkflowActivationJob, 23 | ) 24 | 25 | __all__ = [ 26 | "CancelWorkflow", 27 | "DoUpdate", 28 | "FireTimer", 29 | "InitializeWorkflow", 30 | "NotifyHasPatch", 31 | "QueryWorkflow", 32 | "RemoveFromCache", 33 | "ResolveActivity", 34 | "ResolveChildWorkflowExecution", 35 | "ResolveChildWorkflowExecutionStart", 36 | "ResolveChildWorkflowExecutionStartCancelled", 37 | "ResolveChildWorkflowExecutionStartFailure", 38 | "ResolveChildWorkflowExecutionStartSuccess", 39 | "ResolveNexusOperation", 40 | "ResolveNexusOperationStart", 41 | "ResolveRequestCancelExternalWorkflow", 42 | "ResolveSignalExternalWorkflow", 43 | "SignalWorkflow", 44 | "UpdateRandomSeed", 45 | "WorkflowActivation", 46 | "WorkflowActivationJob", 47 | ] 48 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/workflow_commands/__init__.py: -------------------------------------------------------------------------------- 1 | from .workflow_commands_pb2 import ( 2 | ActivityCancellationType, 3 | CancelChildWorkflowExecution, 4 | CancelSignalWorkflow, 5 | CancelTimer, 6 | CancelWorkflowExecution, 7 | CompleteWorkflowExecution, 8 | ContinueAsNewWorkflowExecution, 9 | FailWorkflowExecution, 10 | ModifyWorkflowProperties, 11 | QueryResult, 12 | QuerySuccess, 13 | RequestCancelActivity, 14 | RequestCancelExternalWorkflowExecution, 15 | RequestCancelLocalActivity, 16 | RequestCancelNexusOperation, 17 | ScheduleActivity, 18 | ScheduleLocalActivity, 19 | ScheduleNexusOperation, 20 | SetPatchMarker, 21 | SignalExternalWorkflowExecution, 22 | StartChildWorkflowExecution, 23 | StartTimer, 24 | UpdateResponse, 25 | UpsertWorkflowSearchAttributes, 26 | WorkflowCommand, 27 | ) 28 | 29 | __all__ = [ 30 | "ActivityCancellationType", 31 | "CancelChildWorkflowExecution", 32 | "CancelSignalWorkflow", 33 | "CancelTimer", 34 | "CancelWorkflowExecution", 35 | "CompleteWorkflowExecution", 36 | "ContinueAsNewWorkflowExecution", 37 | "FailWorkflowExecution", 38 | "ModifyWorkflowProperties", 39 | "QueryResult", 40 | "QuerySuccess", 41 | "RequestCancelActivity", 42 | "RequestCancelExternalWorkflowExecution", 43 | "RequestCancelLocalActivity", 44 | "RequestCancelNexusOperation", 45 | "ScheduleActivity", 46 | "ScheduleLocalActivity", 47 | "ScheduleNexusOperation", 48 | "SetPatchMarker", 49 | "SignalExternalWorkflowExecution", 50 | "StartChildWorkflowExecution", 51 | "StartTimer", 52 | "UpdateResponse", 53 | "UpsertWorkflowSearchAttributes", 54 | "WorkflowCommand", 55 | ] 56 | -------------------------------------------------------------------------------- /temporalio/bridge/proto/workflow_completion/__init__.py: -------------------------------------------------------------------------------- 1 | from .workflow_completion_pb2 import Failure, Success, WorkflowActivationCompletion 2 | 3 | __all__ = [ 4 | "Failure", 5 | "Success", 6 | "WorkflowActivationCompletion", 7 | ] 8 | -------------------------------------------------------------------------------- /temporalio/bridge/testing.py: -------------------------------------------------------------------------------- 1 | """Test server management. (unstable) 2 | 3 | Nothing in this module should be considered stable. The API may change. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | from dataclasses import dataclass 9 | from typing import Optional, Sequence 10 | 11 | import temporalio.bridge.runtime 12 | import temporalio.bridge.temporal_sdk_bridge 13 | 14 | 15 | @dataclass 16 | class DevServerConfig: 17 | """Python representation of the Rust struct for configuring dev server.""" 18 | 19 | existing_path: Optional[str] 20 | sdk_name: str 21 | sdk_version: str 22 | download_version: str 23 | download_dest_dir: Optional[str] 24 | download_ttl_ms: Optional[int] 25 | namespace: str 26 | ip: str 27 | port: Optional[int] 28 | database_filename: Optional[str] 29 | ui: bool 30 | log_format: str 31 | log_level: str 32 | extra_args: Sequence[str] 33 | 34 | 35 | @dataclass 36 | class TestServerConfig: 37 | """Python representation of the Rust struct for configuring test server.""" 38 | 39 | existing_path: Optional[str] 40 | sdk_name: str 41 | sdk_version: str 42 | download_version: str 43 | download_dest_dir: Optional[str] 44 | download_ttl_ms: Optional[int] 45 | port: Optional[int] 46 | extra_args: Sequence[str] 47 | 48 | 49 | class EphemeralServer: 50 | """Python representation of a Rust ephemeral server.""" 51 | 52 | @staticmethod 53 | async def start_dev_server( 54 | runtime: temporalio.bridge.runtime.Runtime, config: DevServerConfig 55 | ) -> EphemeralServer: 56 | """Start a dev server instance.""" 57 | return EphemeralServer( 58 | await temporalio.bridge.temporal_sdk_bridge.start_dev_server( 59 | runtime._ref, config 60 | ) 61 | ) 62 | 63 | @staticmethod 64 | async def start_test_server( 65 | runtime: temporalio.bridge.runtime.Runtime, config: TestServerConfig 66 | ) -> EphemeralServer: 67 | """Start a test server instance.""" 68 | return EphemeralServer( 69 | await temporalio.bridge.temporal_sdk_bridge.start_test_server( 70 | runtime._ref, config 71 | ) 72 | ) 73 | 74 | def __init__(self, ref: temporalio.bridge.temporal_sdk_bridge.EphemeralServerRef): 75 | """Initialize an ephemeral server.""" 76 | self._ref = ref 77 | 78 | @property 79 | def target(self) -> str: 80 | """Frontend address.""" 81 | return self._ref.target 82 | 83 | @property 84 | def has_test_service(self) -> bool: 85 | """Whether this server supports the test service.""" 86 | return self._ref.has_test_service 87 | 88 | async def shutdown(self) -> None: 89 | """Shutdown this server.""" 90 | await self._ref.shutdown() 91 | -------------------------------------------------------------------------------- /temporalio/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | """Extra modules that may have optional dependencies.""" 2 | -------------------------------------------------------------------------------- /temporalio/contrib/openai_agents/__init__.py: -------------------------------------------------------------------------------- 1 | """Support for using the OpenAI Agents SDK as part of Temporal workflows. 2 | 3 | This module provides compatibility between the 4 | `OpenAI Agents SDK `_ and Temporal workflows. 5 | 6 | .. warning:: 7 | This module is experimental and may change in future versions. 8 | Use with caution in production environments. 9 | """ 10 | -------------------------------------------------------------------------------- /temporalio/contrib/openai_agents/_heartbeat_decorator.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | from functools import wraps 3 | from typing import Any, Awaitable, Callable, TypeVar, cast 4 | 5 | from temporalio import activity 6 | 7 | F = TypeVar("F", bound=Callable[..., Awaitable[Any]]) 8 | 9 | 10 | def _auto_heartbeater(fn: F) -> F: 11 | # Propagate type hints from the original callable. 12 | @wraps(fn) 13 | async def wrapper(*args, **kwargs): 14 | heartbeat_timeout = activity.info().heartbeat_timeout 15 | heartbeat_task = None 16 | if heartbeat_timeout: 17 | # Heartbeat twice as often as the timeout 18 | heartbeat_task = asyncio.create_task( 19 | heartbeat_every(heartbeat_timeout.total_seconds() / 2) 20 | ) 21 | try: 22 | return await fn(*args, **kwargs) 23 | finally: 24 | if heartbeat_task: 25 | heartbeat_task.cancel() 26 | # Wait for heartbeat cancellation to complete 27 | await heartbeat_task 28 | 29 | return cast(F, wrapper) 30 | 31 | 32 | async def heartbeat_every(delay: float, *details: Any) -> None: 33 | """Heartbeat every so often while not cancelled""" 34 | while True: 35 | await asyncio.sleep(delay) 36 | activity.heartbeat(*details) 37 | -------------------------------------------------------------------------------- /temporalio/contrib/openai_agents/model_parameters.py: -------------------------------------------------------------------------------- 1 | """Parameters for configuring Temporal activity execution for model calls.""" 2 | 3 | from dataclasses import dataclass 4 | from datetime import timedelta 5 | from typing import Optional 6 | 7 | from temporalio.common import Priority, RetryPolicy 8 | from temporalio.workflow import ActivityCancellationType, VersioningIntent 9 | 10 | 11 | @dataclass 12 | class ModelActivityParameters: 13 | """Parameters for configuring Temporal activity execution for model calls. 14 | 15 | This class encapsulates all the parameters that can be used to configure 16 | how Temporal activities are executed when making model calls through the 17 | OpenAI Agents integration. 18 | """ 19 | 20 | task_queue: Optional[str] = None 21 | """Specific task queue to use for model activities.""" 22 | 23 | schedule_to_close_timeout: Optional[timedelta] = None 24 | """Maximum time from scheduling to completion.""" 25 | 26 | schedule_to_start_timeout: Optional[timedelta] = None 27 | """Maximum time from scheduling to starting.""" 28 | 29 | start_to_close_timeout: Optional[timedelta] = None 30 | """Maximum time for the activity to complete.""" 31 | 32 | heartbeat_timeout: Optional[timedelta] = None 33 | """Maximum time between heartbeats.""" 34 | 35 | retry_policy: Optional[RetryPolicy] = None 36 | """Policy for retrying failed activities.""" 37 | 38 | cancellation_type: ActivityCancellationType = ActivityCancellationType.TRY_CANCEL 39 | """How the activity handles cancellation.""" 40 | 41 | versioning_intent: Optional[VersioningIntent] = None 42 | """Versioning intent for the activity.""" 43 | 44 | summary_override: Optional[str] = None 45 | """Summary for the activity execution.""" 46 | 47 | priority: Priority = Priority.default 48 | """Priority for the activity execution.""" 49 | -------------------------------------------------------------------------------- /temporalio/contrib/openai_agents/open_ai_data_converter.py: -------------------------------------------------------------------------------- 1 | """DataConverter that supports conversion of types used by OpenAI Agents SDK. 2 | 3 | These are mostly Pydantic types. Some of them should be explicitly imported. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | import temporalio.contrib.pydantic 9 | 10 | open_ai_data_converter = temporalio.contrib.pydantic.pydantic_data_converter 11 | """DEPRECATED, use temporalio.contrib.pydantic.pydantic_data_converter""" 12 | -------------------------------------------------------------------------------- /temporalio/contrib/openai_agents/temporal_openai_agents.py: -------------------------------------------------------------------------------- 1 | """Initialize Temporal OpenAI Agents overrides.""" 2 | 3 | from contextlib import contextmanager 4 | from datetime import timedelta 5 | from typing import Optional 6 | 7 | from agents import set_trace_provider 8 | from agents.run import get_default_agent_runner, set_default_agent_runner 9 | from agents.tracing import get_trace_provider 10 | from agents.tracing.provider import DefaultTraceProvider 11 | 12 | from temporalio.common import Priority, RetryPolicy 13 | from temporalio.contrib.openai_agents._openai_runner import TemporalOpenAIRunner 14 | from temporalio.contrib.openai_agents._temporal_trace_provider import ( 15 | TemporalTraceProvider, 16 | ) 17 | from temporalio.contrib.openai_agents.model_parameters import ModelActivityParameters 18 | from temporalio.workflow import ActivityCancellationType, VersioningIntent 19 | 20 | 21 | @contextmanager 22 | def set_open_ai_agent_temporal_overrides( 23 | model_params: ModelActivityParameters, 24 | auto_close_tracing_in_workflows: bool = False, 25 | ): 26 | """Configure Temporal-specific overrides for OpenAI agents. 27 | 28 | .. warning:: 29 | This API is experimental and may change in future versions. 30 | Use with caution in production environments. Future versions may wrap the worker directly 31 | instead of requiring this context manager. 32 | 33 | This context manager sets up the necessary Temporal-specific runners and trace providers 34 | for running OpenAI agents within Temporal workflows. It should be called in the main 35 | entry point of your application before initializing the Temporal client and worker. 36 | 37 | The context manager handles: 38 | 1. Setting up a Temporal-specific runner for OpenAI agents 39 | 2. Configuring a Temporal-aware trace provider 40 | 3. Restoring previous settings when the context exits 41 | 42 | Args: 43 | model_params: Configuration parameters for Temporal activity execution of model calls. 44 | 45 | Returns: 46 | A context manager that yields the configured TemporalTraceProvider. 47 | 48 | """ 49 | if ( 50 | not model_params.start_to_close_timeout 51 | and not model_params.schedule_to_close_timeout 52 | ): 53 | raise ValueError( 54 | "Activity must have start_to_close_timeout or schedule_to_close_timeout" 55 | ) 56 | 57 | previous_runner = get_default_agent_runner() 58 | previous_trace_provider = get_trace_provider() 59 | provider = TemporalTraceProvider( 60 | auto_close_in_workflows=auto_close_tracing_in_workflows 61 | ) 62 | 63 | try: 64 | set_default_agent_runner(TemporalOpenAIRunner(model_params)) 65 | set_trace_provider(provider) 66 | yield provider 67 | finally: 68 | set_default_agent_runner(previous_runner) 69 | set_trace_provider(previous_trace_provider or DefaultTraceProvider()) 70 | -------------------------------------------------------------------------------- /temporalio/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/temporalio/py.typed -------------------------------------------------------------------------------- /temporalio/testing/__init__.py: -------------------------------------------------------------------------------- 1 | """Test framework for workflows and activities.""" 2 | 3 | from ._activity import ActivityEnvironment 4 | from ._workflow import WorkflowEnvironment 5 | 6 | __all__ = [ 7 | "ActivityEnvironment", 8 | "WorkflowEnvironment", 9 | ] 10 | -------------------------------------------------------------------------------- /temporalio/worker/__init__.py: -------------------------------------------------------------------------------- 1 | """Worker for processing Temporal workflows and/or activities.""" 2 | 3 | from ._activity import SharedHeartbeatSender, SharedStateManager 4 | from ._interceptor import ( 5 | ActivityInboundInterceptor, 6 | ActivityOutboundInterceptor, 7 | ContinueAsNewInput, 8 | ExecuteActivityInput, 9 | ExecuteWorkflowInput, 10 | HandleQueryInput, 11 | HandleSignalInput, 12 | HandleUpdateInput, 13 | Interceptor, 14 | SignalChildWorkflowInput, 15 | SignalExternalWorkflowInput, 16 | StartActivityInput, 17 | StartChildWorkflowInput, 18 | StartLocalActivityInput, 19 | WorkflowInboundInterceptor, 20 | WorkflowInterceptorClassInput, 21 | WorkflowOutboundInterceptor, 22 | ) 23 | from ._replayer import ( 24 | Replayer, 25 | ReplayerConfig, 26 | WorkflowReplayResult, 27 | WorkflowReplayResults, 28 | ) 29 | from ._tuning import ( 30 | ActivitySlotInfo, 31 | CustomSlotSupplier, 32 | FixedSizeSlotSupplier, 33 | LocalActivitySlotInfo, 34 | ResourceBasedSlotConfig, 35 | ResourceBasedSlotSupplier, 36 | ResourceBasedTunerConfig, 37 | SlotInfo, 38 | SlotMarkUsedContext, 39 | SlotPermit, 40 | SlotReleaseContext, 41 | SlotReserveContext, 42 | WorkerTuner, 43 | WorkflowSlotInfo, 44 | ) 45 | from ._worker import ( 46 | PollerBehavior, 47 | PollerBehaviorAutoscaling, 48 | PollerBehaviorSimpleMaximum, 49 | Worker, 50 | WorkerConfig, 51 | WorkerDeploymentConfig, 52 | WorkerDeploymentVersion, 53 | ) 54 | from ._workflow_instance import ( 55 | UnsandboxedWorkflowRunner, 56 | WorkflowInstance, 57 | WorkflowInstanceDetails, 58 | WorkflowRunner, 59 | ) 60 | 61 | __all__ = [ 62 | # Primary types 63 | "Worker", 64 | "WorkerConfig", 65 | "WorkerDeploymentConfig", 66 | "WorkerDeploymentVersion", 67 | "Replayer", 68 | "ReplayerConfig", 69 | "WorkflowReplayResult", 70 | "WorkflowReplayResults", 71 | "PollerBehavior", 72 | "PollerBehaviorSimpleMaximum", 73 | "PollerBehaviorAutoscaling", 74 | # Interceptor base classes 75 | "Interceptor", 76 | "ActivityInboundInterceptor", 77 | "ActivityOutboundInterceptor", 78 | "WorkflowInboundInterceptor", 79 | "WorkflowOutboundInterceptor", 80 | # Interceptor input 81 | "ContinueAsNewInput", 82 | "ExecuteActivityInput", 83 | "ExecuteWorkflowInput", 84 | "HandleQueryInput", 85 | "HandleSignalInput", 86 | "HandleUpdateInput", 87 | "SignalChildWorkflowInput", 88 | "SignalExternalWorkflowInput", 89 | "StartActivityInput", 90 | "StartChildWorkflowInput", 91 | "StartLocalActivityInput", 92 | "WorkflowInterceptorClassInput", 93 | # Advanced activity classes 94 | "SharedStateManager", 95 | "SharedHeartbeatSender", 96 | # Advanced workflow classes 97 | "WorkflowRunner", 98 | "WorkflowInstance", 99 | "WorkflowInstanceDetails", 100 | "UnsandboxedWorkflowRunner", 101 | # Tuning types 102 | "WorkerTuner", 103 | "FixedSizeSlotSupplier", 104 | "ResourceBasedSlotSupplier", 105 | "ResourceBasedTunerConfig", 106 | "ResourceBasedSlotConfig", 107 | "ActivitySlotInfo", 108 | "CustomSlotSupplier", 109 | "LocalActivitySlotInfo", 110 | "SlotInfo", 111 | "SlotMarkUsedContext", 112 | "SlotPermit", 113 | "SlotReleaseContext", 114 | "SlotReserveContext", 115 | "WorkflowSlotInfo", 116 | ] 117 | -------------------------------------------------------------------------------- /temporalio/worker/workflow_sandbox/__init__.py: -------------------------------------------------------------------------------- 1 | """Sandbox for Temporal workflows. 2 | 3 | .. warning:: 4 | This API for this module is considered unstable and may change in future. 5 | 6 | This module contains the sandbox for helping ensure workflow determinism. It 7 | does this in two ways: global state isolation and restrictions on making 8 | non-deterministic calls. See the Python SDK documentation for how to use, 9 | customize, and work around sandbox issues. 10 | """ 11 | 12 | # This module is the result of many trial-and-error efforts to isolate state and 13 | # restrict imports. 14 | # 15 | # Approaches to isolating state: 16 | # 17 | # * Using exec() with existing modules copied and use importlib.reload 18 | # * Problem: Reload shares globals 19 | # * Using exec() with custom importer that copies over some modules 20 | # * The current implementation 21 | # * Using Py_NewInterpreter from 22 | # https://docs.python.org/3/c-api/init.html#sub-interpreter-support 23 | # * Not yet tried 24 | # * Will have to investigate whether we can pass through modules 25 | # 26 | # Approaches to import/call restrictions: 27 | # 28 | # * Using sys.addaudithook 29 | # * Problem: No callback for every function 30 | # * Using sys.settrace 31 | # * Problem: Too expensive 32 | # * Using sys.setprofile 33 | # * Problem: Only affects calls, not variable access 34 | # * Custom importer to proxy out bad things 35 | # * The current implementation 36 | # * Could not use sys.meta_path approach because we need to pass through 37 | # modules, not just set their creator/executor 38 | # * Similar wrapper implementation to 39 | # https://github.com/pallets/werkzeug/blob/main/src/werkzeug/local.py 40 | # * TODO(cretz): Investigate whether https://github.com/GrahamDumpleton/wrapt 41 | # would be cleaner 42 | # 43 | # TODO(cretz): TODOs: 44 | # 45 | # * Try subinterpreter via Rust 46 | # * Rework SandboxMatcher to be more robust and easier to build 47 | # * Protobuf issues w/ shared static state: 48 | # * https://github.com/protocolbuffers/protobuf/issues/10143 49 | # * Waiting on https://github.com/protocolbuffers/protobuf/issues/10075 to be 50 | # released 51 | # * Investigate why we can't restrict the "io" library due to BufferedIOBase 52 | # extension issue in shutil/compression 53 | # * ABC issue w/ wrapped subclasses: 54 | # * https://bugs.python.org/issue44847 55 | # * https://github.com/GrahamDumpleton/wrapt/issues/130 56 | 57 | from ._restrictions import ( 58 | RestrictedWorkflowAccessError, 59 | SandboxMatcher, 60 | SandboxRestrictions, 61 | ) 62 | from ._runner import SandboxedWorkflowRunner 63 | 64 | __all__ = [ 65 | "RestrictedWorkflowAccessError", 66 | "SandboxedWorkflowRunner", 67 | "SandboxMatcher", 68 | "SandboxRestrictions", 69 | ] 70 | -------------------------------------------------------------------------------- /temporalio/worker/workflow_sandbox/_in_sandbox.py: -------------------------------------------------------------------------------- 1 | """Code that runs inside the workflow sandbox. 2 | 3 | .. warning:: 4 | This API for this module is considered unstable and may change in future. 5 | """ 6 | 7 | import dataclasses 8 | import logging 9 | from typing import Any, Type 10 | 11 | import temporalio.bridge.proto.workflow_activation 12 | import temporalio.bridge.proto.workflow_completion 13 | import temporalio.worker._workflow_instance 14 | import temporalio.workflow 15 | 16 | logger = logging.getLogger(__name__) 17 | 18 | # Set to true to log lots of sandbox details 19 | LOG_TRACE = False 20 | 21 | 22 | def _trace(message: object, *args: object) -> None: 23 | if LOG_TRACE: 24 | logger.debug(message, *args) 25 | 26 | 27 | class InSandbox: 28 | """Instance that is expected to run inside a sandbox.""" 29 | 30 | def __init__( 31 | self, 32 | instance_details: temporalio.worker._workflow_instance.WorkflowInstanceDetails, 33 | runner_class: Type[temporalio.worker._workflow_instance.WorkflowRunner], 34 | workflow_class: Type, 35 | ) -> None: 36 | """Create in-sandbox instance.""" 37 | _trace("Initializing workflow %s in sandbox", workflow_class) 38 | # We expect to be able to get the workflow definition back off the 39 | # class. We can't use the definition that was given to us because it has 40 | # type hints and references to outside-of-sandbox types. 41 | new_defn = temporalio.workflow._Definition.must_from_class(workflow_class) 42 | 43 | # Also, we have to re-import the worker-level exception types, because 44 | # some exceptions are not passthrough and therefore our issubclass fails 45 | # because it'll be comparing out-of-sandbox types with in-sandbox types 46 | exception_types = instance_details.worker_level_failure_exception_types 47 | if exception_types: 48 | # Copy first, then add in-sandbox types appended 49 | exception_types = list(exception_types) 50 | # Try to re-import each 51 | for typ in instance_details.worker_level_failure_exception_types: 52 | try: 53 | class_hier = typ.__qualname__.split(".") 54 | module = __import__(typ.__module__, fromlist=[class_hier[0]]) 55 | reimported_type: Any = module 56 | for name in class_hier: 57 | reimported_type = getattr(reimported_type, name) 58 | if not issubclass(reimported_type, BaseException): 59 | raise TypeError( 60 | f"Final imported type of {reimported_type} does not extend BaseException" 61 | ) 62 | exception_types.append(reimported_type) 63 | except Exception as err: 64 | raise TypeError( 65 | f"Failed to re-import workflow exception failure type {typ} in sandbox" 66 | ) from err 67 | 68 | new_instance_details = dataclasses.replace( 69 | instance_details, 70 | defn=new_defn, 71 | worker_level_failure_exception_types=exception_types, 72 | ) 73 | 74 | # Instantiate the runner and the instance 75 | self.instance = runner_class().create_instance(new_instance_details) 76 | 77 | def activate( 78 | self, act: temporalio.bridge.proto.workflow_activation.WorkflowActivation 79 | ) -> temporalio.bridge.proto.workflow_completion.WorkflowActivationCompletion: 80 | """Send activation to this instance.""" 81 | return self.instance.activate(act) 82 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # TODO: Change back to "default" after next CLI release 2 | DEV_SERVER_DOWNLOAD_VERSION = "v1.3.1-persistence-fix.0" 3 | -------------------------------------------------------------------------------- /tests/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/tests/api/__init__.py -------------------------------------------------------------------------------- /tests/bridge/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/tests/bridge/__init__.py -------------------------------------------------------------------------------- /tests/bridge/test_runtime.py: -------------------------------------------------------------------------------- 1 | from threading import Event, Thread 2 | from time import sleep 3 | from typing import Optional 4 | 5 | from temporalio.bridge.runtime import Runtime 6 | 7 | 8 | class SomeException(Exception): 9 | pass 10 | 11 | 12 | def test_bridge_runtime_raise_in_thread(): 13 | waiting = Event() 14 | exc_in_thread: Optional[BaseException] = None 15 | 16 | def wait_forever(): 17 | try: 18 | waiting.set() 19 | while True: 20 | sleep(0.1) 21 | except BaseException as err: 22 | nonlocal exc_in_thread 23 | exc_in_thread = err 24 | 25 | # Start thread 26 | thread = Thread(target=wait_forever, daemon=True) 27 | thread.start() 28 | 29 | # Wait until sleeping 30 | waiting.wait(5) 31 | 32 | # Raise exception 33 | assert thread.ident 34 | assert thread.is_alive() 35 | assert Runtime._raise_in_thread(thread.ident, SomeException) 36 | 37 | # Make sure thread completes 38 | thread.join(5) 39 | assert not thread.is_alive() 40 | assert type(exc_in_thread) is SomeException 41 | -------------------------------------------------------------------------------- /tests/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/tests/contrib/__init__.py -------------------------------------------------------------------------------- /tests/contrib/openai_agents/research_agents/planner_agent.py: -------------------------------------------------------------------------------- 1 | from agents import Agent 2 | from pydantic import BaseModel 3 | 4 | PROMPT = ( 5 | "You are a helpful research assistant. Given a query, come up with a set of web searches " 6 | "to perform to best answer the query. Output between 5 and 20 terms to query for." 7 | ) 8 | 9 | 10 | class WebSearchItem(BaseModel): 11 | reason: str 12 | "Your reasoning for why this search is important to the query." 13 | 14 | query: str 15 | "The search term to use for the web search." 16 | 17 | 18 | class WebSearchPlan(BaseModel): 19 | searches: list[WebSearchItem] 20 | """A list of web searches to perform to best answer the query.""" 21 | 22 | 23 | def new_planner_agent(): 24 | return Agent( 25 | name="PlannerAgent", 26 | instructions=PROMPT, 27 | model="gpt-4o", 28 | output_type=WebSearchPlan, 29 | ) 30 | -------------------------------------------------------------------------------- /tests/contrib/openai_agents/research_agents/printer.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | from rich.console import Console, Group 4 | from rich.live import Live 5 | from rich.spinner import Spinner 6 | 7 | 8 | class Printer: 9 | def __init__(self, console: Console): 10 | self.live = Live(console=console) 11 | self.items: dict[str, tuple[str, bool]] = {} 12 | self.hide_done_ids: set[str] = set() 13 | self.live.start() 14 | 15 | def end(self) -> None: 16 | self.live.stop() 17 | 18 | def hide_done_checkmark(self, item_id: str) -> None: 19 | self.hide_done_ids.add(item_id) 20 | 21 | def update_item( 22 | self, 23 | item_id: str, 24 | content: str, 25 | is_done: bool = False, 26 | hide_checkmark: bool = False, 27 | ) -> None: 28 | self.items[item_id] = (content, is_done) 29 | if hide_checkmark: 30 | self.hide_done_ids.add(item_id) 31 | self.flush() 32 | 33 | def mark_item_done(self, item_id: str) -> None: 34 | self.items[item_id] = (self.items[item_id][0], True) 35 | self.flush() 36 | 37 | def flush(self) -> None: 38 | renderables: list[Any] = [] 39 | for item_id, (content, is_done) in self.items.items(): 40 | if is_done: 41 | prefix = "✅ " if item_id not in self.hide_done_ids else "" 42 | renderables.append(prefix + content) 43 | else: 44 | renderables.append(Spinner("dots", text=content)) 45 | self.live.update(Group(*renderables)) 46 | -------------------------------------------------------------------------------- /tests/contrib/openai_agents/research_agents/research_manager.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import asyncio 4 | 5 | from agents import Runner, custom_span, gen_trace_id, trace 6 | 7 | from tests.contrib.openai_agents.research_agents.planner_agent import ( 8 | WebSearchItem, 9 | WebSearchPlan, 10 | new_planner_agent, 11 | ) 12 | from tests.contrib.openai_agents.research_agents.search_agent import new_search_agent 13 | from tests.contrib.openai_agents.research_agents.writer_agent import ( 14 | ReportData, 15 | new_writer_agent, 16 | ) 17 | 18 | 19 | class ResearchManager: 20 | def __init__(self): 21 | self.search_agent = new_search_agent() 22 | self.planner_agent = new_planner_agent() 23 | self.writer_agent = new_writer_agent() 24 | 25 | async def run(self, query: str) -> str: 26 | trace_id = gen_trace_id() 27 | with trace("Research trace", trace_id=trace_id): 28 | search_plan = await self._plan_searches(query) 29 | search_results = await self._perform_searches(search_plan) 30 | report = await self._write_report(query, search_results) 31 | 32 | return report.markdown_report 33 | 34 | async def _plan_searches(self, query: str) -> WebSearchPlan: 35 | result = await Runner.run( 36 | self.planner_agent, 37 | f"Query: {query}", 38 | ) 39 | return result.final_output_as(WebSearchPlan) 40 | 41 | async def _perform_searches(self, search_plan: WebSearchPlan) -> list[str]: 42 | with custom_span("Search the web"): 43 | num_completed = 0 44 | tasks = [ 45 | asyncio.create_task(self._search(item)) for item in search_plan.searches 46 | ] 47 | results = [] 48 | for task in asyncio.as_completed(tasks): 49 | result = await task 50 | if result is not None: 51 | results.append(result) 52 | num_completed += 1 53 | return results 54 | 55 | async def _search(self, item: WebSearchItem) -> str | None: 56 | input = f"Search term: {item.query}\nReason for searching: {item.reason}" 57 | try: 58 | result = await Runner.run( 59 | self.search_agent, 60 | input, 61 | ) 62 | return str(result.final_output) 63 | except Exception: 64 | return None 65 | 66 | async def _write_report(self, query: str, search_results: list[str]) -> ReportData: 67 | input = f"Original query: {query}\nSummarized search results: {search_results}" 68 | result = await Runner.run( 69 | self.writer_agent, 70 | input, 71 | ) 72 | 73 | return result.final_output_as(ReportData) 74 | -------------------------------------------------------------------------------- /tests/contrib/openai_agents/research_agents/search_agent.py: -------------------------------------------------------------------------------- 1 | from agents import Agent, WebSearchTool 2 | from agents.model_settings import ModelSettings 3 | 4 | INSTRUCTIONS = ( 5 | "You are a research assistant. Given a search term, you search the web for that term and " 6 | "produce a concise summary of the results. The summary must 2-3 paragraphs and less than 300 " 7 | "words. Capture the main points. Write succinctly, no need to have complete sentences or good " 8 | "grammar. This will be consumed by someone synthesizing a report, so its vital you capture the " 9 | "essence and ignore any fluff. Do not include any additional commentary other than the summary " 10 | "itself." 11 | ) 12 | 13 | 14 | def new_search_agent(): 15 | return Agent( 16 | name="Search agent", 17 | instructions=INSTRUCTIONS, 18 | tools=[WebSearchTool()], 19 | model_settings=ModelSettings(tool_choice="required"), 20 | ) 21 | -------------------------------------------------------------------------------- /tests/contrib/openai_agents/research_agents/writer_agent.py: -------------------------------------------------------------------------------- 1 | # Agent used to synthesize a final report from the individual summaries. 2 | from agents import Agent 3 | from pydantic import BaseModel 4 | 5 | PROMPT = ( 6 | "You are a senior researcher tasked with writing a cohesive report for a research query. " 7 | "You will be provided with the original query, and some initial research done by a research " 8 | "assistant.\n" 9 | "You should first come up with an outline for the report that describes the structure and " 10 | "flow of the report. Then, generate the report and return that as your final output.\n" 11 | "The final output should be in markdown format, and it should be lengthy and detailed. Aim " 12 | "for 5-10 pages of content, at least 1000 words." 13 | ) 14 | 15 | 16 | class ReportData(BaseModel): 17 | short_summary: str 18 | """A short 2-3 sentence summary of the findings.""" 19 | 20 | markdown_report: str 21 | """The final report""" 22 | 23 | follow_up_questions: list[str] 24 | """Suggested topics to research further""" 25 | 26 | 27 | def new_writer_agent(): 28 | return Agent( 29 | name="WriterAgent", 30 | instructions=PROMPT, 31 | model="o3-mini", 32 | output_type=ReportData, 33 | ) 34 | -------------------------------------------------------------------------------- /tests/contrib/openai_agents/test_openai_replay.py: -------------------------------------------------------------------------------- 1 | from datetime import timedelta 2 | from pathlib import Path 3 | 4 | import pytest 5 | 6 | from temporalio.client import WorkflowHistory 7 | from temporalio.contrib.openai_agents.model_parameters import ModelActivityParameters 8 | from temporalio.contrib.openai_agents.open_ai_data_converter import ( 9 | open_ai_data_converter, 10 | ) 11 | from temporalio.contrib.openai_agents.temporal_openai_agents import ( 12 | set_open_ai_agent_temporal_overrides, 13 | ) 14 | from temporalio.worker import Replayer 15 | from tests.contrib.openai_agents.test_openai import ( 16 | AgentsAsToolsWorkflow, 17 | CustomerServiceWorkflow, 18 | HelloWorldAgent, 19 | InputGuardrailWorkflow, 20 | OutputGuardrailWorkflow, 21 | ResearchWorkflow, 22 | ToolsWorkflow, 23 | ) 24 | 25 | 26 | @pytest.mark.parametrize( 27 | "file_name", 28 | [ 29 | "agents-as-tools-workflow-history.json", 30 | "customer-service-workflow-history.json", 31 | "hello-workflow-history.json", 32 | "input-guardrail-workflow-history.json", 33 | "output-guardrail-workflow-history.json", 34 | "research-workflow-history.json", 35 | "tools-workflow-history.json", 36 | ], 37 | ) 38 | async def test_replay(file_name: str) -> None: 39 | with (Path(__file__).with_name("histories") / file_name).open("r") as f: 40 | history_json = f.read() 41 | 42 | model_params = ModelActivityParameters( 43 | start_to_close_timeout=timedelta(seconds=120) 44 | ) 45 | with set_open_ai_agent_temporal_overrides(model_params): 46 | await Replayer( 47 | workflows=[ 48 | ResearchWorkflow, 49 | ToolsWorkflow, 50 | CustomerServiceWorkflow, 51 | AgentsAsToolsWorkflow, 52 | HelloWorldAgent, 53 | InputGuardrailWorkflow, 54 | OutputGuardrailWorkflow, 55 | ], 56 | data_converter=open_ai_data_converter, 57 | ).replay_workflow(WorkflowHistory.from_json("fake", history_json)) 58 | -------------------------------------------------------------------------------- /tests/contrib/pydantic/activities.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import List 3 | from uuid import UUID 4 | 5 | from temporalio import activity 6 | from tests.contrib.pydantic.models import PydanticModels 7 | 8 | 9 | @activity.defn 10 | async def pydantic_objects_activity( 11 | models: List[PydanticModels], 12 | ) -> List[PydanticModels]: 13 | return models 14 | 15 | 16 | @activity.defn 17 | async def misc_objects_activity( 18 | models: tuple[ 19 | int, 20 | str, 21 | dict[str, float], 22 | list[dict[str, float]], 23 | tuple[dict[str, float]], 24 | datetime, 25 | UUID, 26 | ], 27 | ) -> tuple[ 28 | int, 29 | str, 30 | dict[str, float], 31 | list[dict[str, float]], 32 | tuple[dict[str, float]], 33 | datetime, 34 | UUID, 35 | ]: 36 | return models 37 | -------------------------------------------------------------------------------- /tests/helpers/external_coroutine.py: -------------------------------------------------------------------------------- 1 | """ 2 | File used in conjunction with external_stack_trace.py to test filenames in multi-file workflows. 3 | """ 4 | 5 | from typing import List 6 | 7 | from temporalio import workflow 8 | 9 | 10 | async def never_completing_coroutine(status: List[str]) -> None: 11 | status[0] = "waiting" # external coroutine test 12 | await workflow.wait_condition(lambda: False) 13 | 14 | 15 | async def wait_on_timer(status: List[str]) -> None: 16 | status[0] = "waiting" # multifile test 17 | print("Coroutine executed, waiting.") 18 | await workflow.wait_condition(lambda: False) 19 | -------------------------------------------------------------------------------- /tests/helpers/external_stack_trace.py: -------------------------------------------------------------------------------- 1 | """ 2 | File used to test external filenames with __enhanced_stack_trace. 3 | """ 4 | 5 | import asyncio 6 | from datetime import timedelta 7 | 8 | from temporalio import activity, workflow 9 | from tests.helpers.external_coroutine import never_completing_coroutine, wait_on_timer 10 | 11 | 12 | @activity.defn 13 | async def external_wait_cancel() -> str: 14 | try: 15 | if activity.info().is_local: 16 | await asyncio.sleep(1000) 17 | else: 18 | while True: 19 | await asyncio.sleep(0.3) 20 | activity.heartbeat() 21 | return "Manually stopped" 22 | except asyncio.CancelledError: 23 | return "Got cancelled error, cancelled? " + str(activity.is_cancelled()) 24 | 25 | 26 | @workflow.defn 27 | class ExternalStackTraceWorkflow: 28 | def __init__(self) -> None: 29 | self._status = ["created"] 30 | 31 | @workflow.run 32 | async def run(self) -> None: 33 | # Start several tasks 34 | self._status = ["spawning"] 35 | awaitables = [ 36 | asyncio.sleep(1000), 37 | workflow.execute_activity( 38 | external_wait_cancel, schedule_to_close_timeout=timedelta(seconds=1000) 39 | ), 40 | never_completing_coroutine(self._status), 41 | ] 42 | await workflow.wait([asyncio.create_task(v) for v in awaitables]) 43 | 44 | @workflow.query 45 | def status(self) -> str: 46 | return self._status[0] 47 | 48 | 49 | @workflow.defn 50 | class MultiFileStackTraceWorkflow: 51 | def __init__(self) -> None: 52 | self._status = ["created"] 53 | 54 | @workflow.run 55 | async def run_multifile_workflow(self) -> None: 56 | await wait_on_timer(self._status) 57 | 58 | @workflow.query 59 | def status(self) -> str: 60 | return self._status[0] 61 | -------------------------------------------------------------------------------- /tests/testing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/tests/testing/__init__.py -------------------------------------------------------------------------------- /tests/worker/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/tests/worker/__init__.py -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/temporalio/sdk-python/9d40e8699ad985d7361c707be28a2e9554c71833/tests/worker/workflow_sandbox/__init__.py -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/__init__.py: -------------------------------------------------------------------------------- 1 | from temporalio.worker.workflow_sandbox._restrictions import ( 2 | SandboxMatcher, 3 | SandboxRestrictions, 4 | ) 5 | 6 | restrictions = SandboxRestrictions( 7 | passthrough_modules=SandboxRestrictions.passthrough_modules_with_temporal 8 | | {"tests.worker.workflow_sandbox.testmodules.passthrough_module"}, 9 | invalid_modules=SandboxMatcher.nested_child( 10 | "tests.worker.workflow_sandbox.testmodules".split("."), 11 | SandboxMatcher(access={"invalid_module"}), 12 | ), 13 | invalid_module_members=SandboxMatcher.nested_child( 14 | "tests.worker.workflow_sandbox.testmodules.invalid_module_members".split("."), 15 | SandboxMatcher(use={"invalid_function"}), 16 | ), 17 | ) 18 | -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/invalid_module.py: -------------------------------------------------------------------------------- 1 | # Do nothing 2 | -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/invalid_module_members.py: -------------------------------------------------------------------------------- 1 | def invalid_function(): 2 | return "oh no" 3 | -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/module_calling_invalid.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | random.choice(["foo", "bar"]) 4 | -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/passthrough_module.py: -------------------------------------------------------------------------------- 1 | module_state = ["module orig"] 2 | -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/proto/__init__.py: -------------------------------------------------------------------------------- 1 | from .proto_message_pb2 import SomeMessage 2 | 3 | __all__ = [ 4 | "SomeMessage", 5 | ] 6 | -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/proto/proto_message.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package worker.workflow_sandbox.testmodules.proto; 4 | 5 | import "google/protobuf/duration.proto"; 6 | 7 | message SomeMessage { 8 | google.protobuf.Duration some_duration = 1; 9 | } -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/proto/proto_message_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: worker/workflow_sandbox/testmodules/proto/proto_message.proto 4 | """Generated protocol buffer code.""" 5 | 6 | from google.protobuf import descriptor as _descriptor 7 | from google.protobuf import descriptor_pool as _descriptor_pool 8 | from google.protobuf import message as _message 9 | from google.protobuf import reflection as _reflection 10 | from google.protobuf import symbol_database as _symbol_database 11 | 12 | # @@protoc_insertion_point(imports) 13 | 14 | _sym_db = _symbol_database.Default() 15 | 16 | 17 | from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 18 | 19 | DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( 20 | b'\n=worker/workflow_sandbox/testmodules/proto/proto_message.proto\x12)worker.workflow_sandbox.testmodules.proto\x1a\x1egoogle/protobuf/duration.proto"?\n\x0bSomeMessage\x12\x30\n\rsome_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Durationb\x06proto3' 21 | ) 22 | 23 | 24 | _SOMEMESSAGE = DESCRIPTOR.message_types_by_name["SomeMessage"] 25 | SomeMessage = _reflection.GeneratedProtocolMessageType( 26 | "SomeMessage", 27 | (_message.Message,), 28 | { 29 | "DESCRIPTOR": _SOMEMESSAGE, 30 | "__module__": "worker.workflow_sandbox.testmodules.proto.proto_message_pb2", 31 | # @@protoc_insertion_point(class_scope:worker.workflow_sandbox.testmodules.proto.SomeMessage) 32 | }, 33 | ) 34 | _sym_db.RegisterMessage(SomeMessage) 35 | 36 | if _descriptor._USE_C_DESCRIPTORS == False: 37 | DESCRIPTOR._options = None 38 | _SOMEMESSAGE._serialized_start = 140 39 | _SOMEMESSAGE._serialized_end = 203 40 | # @@protoc_insertion_point(module_scope) 41 | -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/proto/proto_message_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | 6 | import builtins 7 | import sys 8 | 9 | import google.protobuf.descriptor 10 | import google.protobuf.duration_pb2 11 | import google.protobuf.message 12 | 13 | if sys.version_info >= (3, 8): 14 | import typing as typing_extensions 15 | else: 16 | import typing_extensions 17 | 18 | DESCRIPTOR: google.protobuf.descriptor.FileDescriptor 19 | 20 | class SomeMessage(google.protobuf.message.Message): 21 | DESCRIPTOR: google.protobuf.descriptor.Descriptor 22 | 23 | SOME_DURATION_FIELD_NUMBER: builtins.int 24 | @property 25 | def some_duration(self) -> google.protobuf.duration_pb2.Duration: ... 26 | def __init__( 27 | self, 28 | *, 29 | some_duration: google.protobuf.duration_pb2.Duration | None = ..., 30 | ) -> None: ... 31 | def HasField( 32 | self, field_name: typing_extensions.Literal["some_duration", b"some_duration"] 33 | ) -> builtins.bool: ... 34 | def ClearField( 35 | self, field_name: typing_extensions.Literal["some_duration", b"some_duration"] 36 | ) -> None: ... 37 | 38 | global___SomeMessage = SomeMessage 39 | -------------------------------------------------------------------------------- /tests/worker/workflow_sandbox/testmodules/stateful_module.py: -------------------------------------------------------------------------------- 1 | module_state = ["module orig"] 2 | --------------------------------------------------------------------------------