Skip to main content

zeebe Python gRPC gateway files

This package contains two gRPC Gateway Files needed to build a zeebe-client or a zeebe-worker (https://zeebe.io/) with Python.

Both files were generated following the instructions on this (now outdated) blog post: https://zeebe.io/blog/2018/11/grpc-generating-a-zeebe-python-client/

How to install and use this package?

pip install zeebe-grpc
import json
import logging
import grpc
from zeebe_grpc import gateway_pb2, gateway_pb2_grpc

with grpc.insecure_channel("localhost:26500") as channel:
    stub = gateway_pb2_grpc.GatewayStub(channel)

    # print the topology of the zeebe cluster
    topology = stub.Topology(gateway_pb2.TopologyRequest())
    print(topology)

    # deploy a process definition
    with open("bpmn/echo.bpmn", "rb") as process_definition_file:
        process_definition = process_definition_file.read()
        process = gateway_pb2.ProcessRequestObject(
            name="echo.bpmn",
            definition=process_definition
        )
    stub.DeployProcess(
        gateway_pb2.DeployProcessRequest(
            processes=[process]
        )
    )

    # start a process instance
    variables = {
        "message": "This is a Message"
    }
    stub.CreateProcessInstance(
        gateway_pb2.CreateProcessInstanceRequest(
            bpmnProcessId="ECHO",
            version=-1,
            variables=json.dumps(variables)
        )
    )

    # start a worker
    activate_jobs_response = stub.ActivateJobs(
        gateway_pb2.ActivateJobsRequest(
            type="echo",
            worker="Python worker",
            timeout=60000,
            maxJobsToActivate=32
        )
    )
    for response in activate_jobs_response:
        for job in response.jobs:
            try:
                print(job.variables)
                stub.CompleteJob(gateway_pb2.CompleteJobRequest(jobKey=job.key, variables=json.dumps({})))
                logging.info("Job Completed")
            except Exception as e:
                stub.FailJob(gateway_pb2.FailJobRequest(jobKey=job.key))
                logging.info(f"Job Failed {e}")

How to (re)build the Python gRPC?

wget https://raw.githubusercontent.com/zeebe-io/zeebe/0.21.1/gateway-protocol/src/main/proto/gateway.proto -O ./zeebe_grpc/gateway.proto

python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. ./zeebe_grpc/gateway.proto

Metadata

Release files for zeebe-grpc 8.4.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zeebe-grpc 8.4.13
File Size Uploaded
zeebe_grpc-8.4.13.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zeebe-grpc 8.4.13
File Interpreter ABI Platform
zeebe_grpc-8.4.13-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / zeebe_grpc-8.4.13.tar.gz

Download URL zeebe_grpc-8.4.13.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6036494373e06c1fe31d90a335d13ed60b7d0c8c2af2b46b31440ab5259c29cc
BLAKE2b-256 checksum
How to use checksums
60520558fd0964d1f5717767d69c419200a3ac45dd2a44fbc7c69e3c5d3ddf09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release files / zeebe_grpc-8.4.13-py3-none-any.whl

Download URL zeebe_grpc-8.4.13-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eeff91bb9b1cbb4844590ea0381ee5f9bfc87d2848d95d8fdfd3de693706e6ca
BLAKE2b-256 checksum
How to use checksums
436e0917fc47f512a8147854d7e05922c78efb9f91cae14209470a7a68694874
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release history Release notifications | RSS feed

This release

8.4.13 This release

2 release files

8.4.0

2 release files

8.3.5

2 release files

8.2.20

2 release files

8.2.13

2 release files

8.1.16

2 release files

8.0.21

2 release files

8.0.4

2 release files

8.0.3

2 release files

8.0.2

2 release files

8.0.1

2 release files

8.0.0

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page