{"id":24698618,"url":"https://github.com/faradayio/status_workflow_ruby","last_synced_at":"2026-05-19T15:05:42.431Z","repository":{"id":59156437,"uuid":"149820037","full_name":"faradayio/status_workflow_ruby","owner":"faradayio","description":"State machine used internally at Faraday (ruby).","archived":false,"fork":false,"pushed_at":"2018-12-06T17:34:12.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-24T19:31:59.935Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/faradayio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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":"2018-09-21T21:28:30.000Z","updated_at":"2018-12-06T17:34:14.000Z","dependencies_parsed_at":"2022-09-13T20:10:20.651Z","dependency_job_id":null,"html_url":"https://github.com/faradayio/status_workflow_ruby","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fstatus_workflow_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fstatus_workflow_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fstatus_workflow_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faradayio%2Fstatus_workflow_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faradayio","download_url":"https://codeload.github.com/faradayio/status_workflow_ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902936,"owners_count":20529114,"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":[],"created_at":"2025-01-27T04:29:30.963Z","updated_at":"2026-05-19T15:05:41.217Z","avatar_url":"https://github.com/faradayio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StatusWorkflow\n\n[![Build Status](https://travis-ci.org/faradayio/status_workflow_ruby.svg?branch=master)](https://travis-ci.org/faradayio/status_workflow_ruby)\n\nBasic state machine using Redis for locking.\n\n## Usage\n\n```\nrequire 'redis'\nStatusWorkflow.redis = Redis.new\n```\n\nYou need an object that has `status`, `status_changed_at`, and `status_error`.\n\nExpects but does not require ActiveRecord (you just have to respond to `#reload`, `#id`, and `#update_columns`)\n\n```\nclass Pet \u003c ActiveRecord::Base\n  before_create do\n    self.status ||= 'sleep'\n  end\n  include StatusWorkflow\n  status_workflow(\n    sleep: [:fed],\n    fed: [:sleep, :run],\n    run: [:sleep],\n  )\nend\n```\n\nwhere\n\n```\n    sleep: [:fed],\n    fed: [:sleep, :run],\n    run: [:sleep],\n```\n\nmeans:\n\n* from sleep, i can go to fed\n* from fed, i can go to sleep or run\n* from run, i can go to sleep\n\nIf you want \u003e1 status, you do\n\n```\n  include StatusWorkflow\n  status_workflow(\n    nil =\u003e {\n      sleep: [:feeding],\n      feeding: [:fed],\n      fed: [:sleep, :run],\n      run: [:sleep],\n    },\n    alt: {\n      sleep2: [:feeding2],\n      feeding2: [:fed2],\n      fed2: [:sleep2, :run2],\n      run2: [:sleep2],\n    }\n  )\n```\n\nYou need an object that has `alt_status`, `alt_status_changed_at`, and `alt_status_error`.\n\n## Sponsor\n\n\u003cp\u003e\u003ca href=\"https://www.faraday.io\"\u003e\u003cimg src=\"https://s3.amazonaws.com/faraday-assets/files/img/logo.svg\" alt=\"Faraday logo\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\nWe use [`status_workflow`](https://github.com/faradayio/status_workflow_ruby) for [B2C customer lifecycle optimization at Faraday](https://www.faraday.io).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/status_workflow. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\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## Code of Conduct\n\nEveryone interacting in the StatusWorkflow project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/status_workflow/blob/master/CODE_OF_CONDUCT.md).\n\n## Copyright\n\nCopyright 2018 Faraday\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fstatus_workflow_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaradayio%2Fstatus_workflow_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaradayio%2Fstatus_workflow_ruby/lists"}