{"id":13408166,"url":"https://github.com/gottfrois/beez","last_synced_at":"2025-07-31T22:39:48.331Z","repository":{"id":39685355,"uuid":"198065968","full_name":"gottfrois/beez","owner":"gottfrois","description":"Simple, efficient ruby workers for Zeebe workflows.","archived":false,"fork":false,"pushed_at":"2023-01-19T22:23:22.000Z","size":321,"stargazers_count":9,"open_issues_count":12,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T12:01:36.368Z","etag":null,"topics":["bpmn","rails","ruby","workflow","zeebe"],"latest_commit_sha":null,"homepage":"https://github.com/gottfrois/beez","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gottfrois.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-21T14:23:31.000Z","updated_at":"2024-02-13T06:08:40.000Z","dependencies_parsed_at":"2023-02-11T22:02:06.950Z","dependency_job_id":null,"html_url":"https://github.com/gottfrois/beez","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gottfrois%2Fbeez","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gottfrois%2Fbeez/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gottfrois%2Fbeez/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gottfrois%2Fbeez/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gottfrois","download_url":"https://codeload.github.com/gottfrois/beez/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248147956,"owners_count":21055546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bpmn","rails","ruby","workflow","zeebe"],"created_at":"2024-07-30T20:00:51.148Z","updated_at":"2025-04-12T17:34:50.692Z","avatar_url":"https://github.com/gottfrois.png","language":"Ruby","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/gottfrois/beez\"\u003e\u003cimg src=\"https://github.com/gottfrois/beez/blob/master/assets/images/bee.png?raw=true\" alt=\"Beez\" width=\"200\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  Beez\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  Simple, efficient ruby workers for \u003ca href=\"https://zeebe.io/\" target=\"_blank\"\u003eZeebe\u003c/a\u003e.\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://badge.fury.io/rb/beez\"\u003e\u003cimg src=\"https://badge.fury.io/rb/beez.svg\" alt=\"Gem Version\" height=\"18\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features-\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#disclaimer-%EF%B8%8F\"\u003eDisclaimer\u003c/a\u003e •\n  \u003ca href=\"#getting-started-\"\u003eGetting Started\u003c/a\u003e •\n  \u003ca href=\"#usage-\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#configuration-\"\u003eConfiguration\u003c/a\u003e •\n  \u003ca href=\"#example-\"\u003eExample\u003c/a\u003e •\n  \u003ca href=\"#license-\"\u003eLicense\u003c/a\u003e •\n  \u003ca href=\"#credits-\"\u003eCredits\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/gottfrois/beez/blob/master/assets/images/zeebe-operate.jpeg?raw=true\" alt=\"Zeebe Operate\"\u003e\n  \u003cem\u003eBeez lets you consume Zeebe workflows like this one!\u003c/em\u003e\n\u003c/p\u003e\n\n## Features ✨\n\n- Beez integrates with [Zeebe](https://zeebe.io/), a free and source-available workflow engine for microservices orchestration\n- Beez integrates with you Rails application\n- Beez runs your workers asynchronously\n- Beez automatically marks your jobs as failures uppon Ruby exceptions\n- Beez has very few dependencies\n\n## Disclaimer ⚠️\n\n- Beez is currently a pre-release\n- Beez has currently **not being tested in production**\n- Beez is currently lacking unit tests, any help is welcome!\n\n## Getting Started 🎓\n\nThese instructions will help you get started with [Zeebe](https://zeebe.io/)\nand Beez. [Zeebe](https://zeebe.io/) already provides an extensive [documentation](https://docs.zeebe.io/)\nI highly suggest you to check it out before.\n\n### Prerequisites ☔️\n\n- You need [Zeebe up and running](https://docs.zeebe.io/introduction/install.html)\n- Ruby \u003e= 2.5 \u0026 \u003c 2.7\n- Rails \u003e= 4 (optional)\n\n### How It Works ⚙️\n\nWorkflows are flowchart-like blueprints that define the orchestration of tasks.\nEvery task represents a piece of business logic such that the ordered execution\nproduces a meaningful result.\n\nBeez lets you define job workers as Ruby classes which is your implementation of\nthe business logic required to complete a task.\n\nRunning a workflow then requires two steps:\n\n1. Submitting the workflow to Zeebe\n2. Creating job workers that can request jobs from Zeebe and complete them\n\n### Installation ☕️\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'beez', '~\u003e 0.1'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install beez\n\n### Usage 🎆\n\nLet's start by creating some workers. In your Rails application, those would be\ndefined under `app/jobs` or `app/workers` for example.\n\n```ruby\nclass MyWorker\n  include ::Beez::Worker\n\n  type \"service-task-name\"\n  max_jobs_to_activate 5 # optional, default to 1\n  poll_interval 1 # optional, default to 5\n  timeout 30 # optional, default to 30\n\n  def process(job)\n    # do something\n  end\nend\n```\n\nEach worker automatically polls for new jobs at `poll_interval` interval. They\nare configured to accepts a `max_jobs_to_activate` jobs at the same time.\nWorkers have exactly `timeout` seconds to process the job before the broker\nconsider it as expired and schedule it to another worker.\n\nThe `process` instance method receives a `job` instance which holds the job's\nattributes such as the `variables` the job received. You can get the complete\nlist of attributes available [here](https://github.com/zeebe-io/zeebe-client-ruby/blob/master/lib/zeebe/client/proto/gateway_pb.rb#L20-L32)\n\nAssuming you have [Zeebe](https://zeebe.io/) up and running, simply start Beez\nfrom the root of your Rails application:\n\n```sh\nbundle exec beez\n```\n\nThat's it.\n\n### Configuration 🔧\n\nBeez comes configured with global sane defaults but you can always\noverrides them using either env variables in some cases or the `configure`\nblock:\n\n```ruby\n# Here are the global defaults already configured for you\nBeez.configure do |config|\n  config.env = ENV[\"APP_ENV\"] || ENV[\"RAILS_ENV\"] || ENV[\"RACK_ENV\"] || \"development\"\n  config.logger = Logger.new($stdout)\n  config.require = \".\"\n  config.timeout = 30\n  config.zeebe_url = ENV['ZEEBE_URL'] || 'localhost:26500'\nend\n```\n\n### Example 📘\n\nLet's get the full picture by deploying a dummy [Order Process](https://github.com/gottfrois/beez/blob/master/bpmn/order-process.bpmn) workflow to Zeebe and\ndefine simple workers as plain Ruby objects.\n\n![Order Process](https://github.com/gottfrois/beez/blob/master/assets/images/order-process.png?raw=true)\n\n1. Start Zeebe and Zeebe Operate:\n\n```sh\ngit clone https://github.com/camunda-cloud/camunda-cloud-get-started/\ndocker-compose up\n```\n\n2. Head to [http://localhost:8080](http://localhost:8080)\n\n- Login: `demo`\n- Password: `demo`\n\n3. Start Beez using our example workers located at [`examples/workers.rb`](https://github.com/gottfrois/beez/blob/master/examples/workers.rb):\n\n```sh\nbeez --timeout 5 --require ./examples/workers.rb\n```\n\n4. Start an `irb` session:\n\n```sh\nirb -r beez\n```\n\n5. Interact with Zeebe directly from the gem:\n\n```ruby\n2.6.6 :001 \u003e # Deploy a process to Zeebe\n2.6.6 :002 \u003e Beez.client.deploy_process(processes: [name: \"order-process\", definition: File.read('/path/to/beez/bpmn/order-process.bpmn')])\n2.6.6 :003 \u003e # Create a new instance of this process\n2.6.6 :004 \u003e Beez.client.create_process_instance(bpmnProcessId: \"order-process\", version: 1, variables: { orderId: \"1234\", orderValue: 94 }.to_json)\n2.6.6 :005 \u003e # Watch Beez automatically executing the first task!\n2.6.6 :006 \u003e # Publish a business message to simulate a payment received event\n2.6.6 :007 \u003e Beez.client.publish_message(name: \"payment-received\", correlationKey: \"1234\")\n```\n\nThat's it!\n\n_Check out all the available commands in [`lib/beez/client.rb`](https://github.com/gottfrois/beez/blob/master/lib/beez/client.rb)._\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing 🤝\n\nBug reports and pull requests are welcome on GitHub at https://github.com/gottfrois/beez.\n\n## License 📜\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Credits 👏\n\n- The [Sidekiq](https://github.com/mperham/sidekiq) authors and contributors for\n  their inspirational codebase which helped me to build this gem\n- [Logo vector created by raftel - www.freepik.com](https://www.freepik.com/free-photos-vectors/logo)\n","funding_links":[],"categories":["Clients and Programming Framework Integrations"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgottfrois%2Fbeez","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgottfrois%2Fbeez","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgottfrois%2Fbeez/lists"}