{"id":13878988,"url":"https://github.com/joelmoss/sidekiq-sequence","last_synced_at":"2026-03-09T19:39:24.120Z","repository":{"id":43187584,"uuid":"271878109","full_name":"joelmoss/sidekiq-sequence","owner":"joelmoss","description":"Sequential Sidekiq jobs for Rails","archived":false,"fork":false,"pushed_at":"2023-04-12T05:54:32.000Z","size":47,"stargazers_count":61,"open_issues_count":7,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-16T11:25:33.073Z","etag":null,"topics":["background-jobs","ruby","ruby-on-rails","sidekiq"],"latest_commit_sha":null,"homepage":"","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/joelmoss.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-12T19:47:53.000Z","updated_at":"2025-01-02T05:03:27.000Z","dependencies_parsed_at":"2024-11-13T16:41:12.994Z","dependency_job_id":"44073da9-4cc6-43c9-8828-d719cedf54a3","html_url":"https://github.com/joelmoss/sidekiq-sequence","commit_stats":{"total_commits":39,"total_committers":5,"mean_commits":7.8,"dds":"0.15384615384615385","last_synced_commit":"cbace1f043eee2836c7b8494797dfe49f6985716"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelmoss%2Fsidekiq-sequence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelmoss%2Fsidekiq-sequence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelmoss%2Fsidekiq-sequence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelmoss%2Fsidekiq-sequence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joelmoss","download_url":"https://codeload.github.com/joelmoss/sidekiq-sequence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235516762,"owners_count":19002685,"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":["background-jobs","ruby","ruby-on-rails","sidekiq"],"created_at":"2024-08-06T08:02:06.188Z","updated_at":"2025-10-06T09:31:20.799Z","avatar_url":"https://github.com/joelmoss.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Sidekiq::Sequence - Sequential Sidekiq jobs.\n\nSidekiq is awesome, but it doesn't provide any support for sequential jobs, where a sequence of jobs must be run in a set order.\n\nSidekiq::Sequence provides a simple yet powerful framework to run a sequence of Sidekiq jobs, where each job runs only when the previous job successfully completes. It relies on Sidekiq's retry functionality to handle failed jobs. So if a job fails, any subsequent jobs will not run. Once the job is retried and is successful, the next job will start.\n\n\u003e **NOTE:** Sidekiq::Sequence is currently only intended for use in Rails applications.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'sidekiq-sequence'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install sidekiq-sequence\n\nRun the Rails generator to install the database migration:\n\n    $ rails g sidekiq_sequence:install\n    $ rails db:migrate\n\n## Usage\n\nStart with a Sequence class which inherits from `Sidekiq::Sequence::Base`, and define each step of the sequence:\n\n```ruby\nclass ContactFormSequence \u003c Sidekiq::Sequence::Base\n  step CreateMessage\n  step AssignMessage\nend\n```\n\nEach step should be a class that includes `Sidekiq::Sequence::Worker`, and behaves just like a regular Sidekiq Worker:\n\n```ruby\nclass ContactFormSequence::CreateMessage\n  include Sidekiq::Sequence::Worker\n\n  def perform\n    # Perform your job\n  end\nend\n```\n\nEach Step is run in the order they are defined, and each is a Sidekiq worker. If a worker fails, subsequent steps will not be run, and the worker will be placed in the Sidekiq retry queue. Once it succeeds, the next step will be run, and so on.\n\nStart a Sequence by simply initializing the Sequence class you created:\n\n```ruby\nContactFormSequence.new name: 'Joel', github: 'joelmoss'\n```\n\nYou can pass named arguments, and these will be persisted and available in the Sequence and its workers:\n\n```ruby\nclass ContactFormSequence::CreateMessage\n  include Sidekiq::Sequence::Worker\n\n  def perform\n    @data # -\u003e { name: 'Joel', github: 'joelmoss' }\n  end\nend\n```\n\nYou can also modify Sequence `data` in any worker, which is great for passing data to subsequent steps:\n\n```ruby\nclass ContactFormSequence::AssignMessage\n  include Sidekiq::Sequence::Worker\n\n  def perform\n    @data[:message] = 'my message' # @data is now { name: 'Joel', github: 'joelmoss', message: 'my message' }\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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/joelmoss/sidekiq-sequence. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/joelmoss/sidekiq-sequence/blob/master/CODE_OF_CONDUCT.md).\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 Sidekiq::Sequence project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/joelmoss/sidekiq-sequence/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelmoss%2Fsidekiq-sequence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoelmoss%2Fsidekiq-sequence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelmoss%2Fsidekiq-sequence/lists"}