Skip to main content

How to run serial (multi-step) background jobs?

Rails • Asked by Daniel Weaver

After a user submits a URL via a form I need to run a handful of jobs in series

What would be a good way to do this?

  1. User submits URL
  2. Use the URL to build file paths
  3. Download file 1 from file path and upload to S3
  4. Download file 2 from file path and upload to S3
  5. Call an API endpoint with the S3 URLs

Steps 3 and 4 could be done in parallel but they both need to be complete before step 5 can run so I'm just going to keep it simple and run all in series.

The naïve option seems to be simply call each step at the end of the previous one. I found this article on multi-step jobs but it seems overly complicated.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.