Skip to content

Add guide for migrating Sidekiq job queues to Standalone Activities - #5202

Draft
brianmacdonald-temporal wants to merge 2 commits into
mainfrom
sidekiq-to-standalone-activity
Draft

Add guide for migrating Sidekiq job queues to Standalone Activities#5202
brianmacdonald-temporal wants to merge 2 commits into
mainfrom
sidekiq-to-standalone-activity

Conversation

@brianmacdonald-temporal

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a Ruby guide, Migrate a Sidekiq job queue to a Temporal Standalone Activity, that walks through converting a Sidekiq job into a Standalone Activity:

  • Maps Sidekiq concepts (job, sidekiq process, Redis, perform_async, sidekiq_options retry:, Web UI) onto their Temporal equivalents
  • Runs an Activity-only Worker with no Workflow code
  • Replaces perform_async with client.start_activity(), and adds a return value via client.execute_activity() — something Sidekiq's fire-and-forget model can't provide
  • Migrates sidekiq_options retry: N to a Retry Policy (with the total-attempts vs. retries adjustment: retry: 5 -> max_attempts: 6)
  • Uses client.list_activities() and client.count_activities() in place of the Sidekiq Web UI

Also links the page from the Guides sidebar and adds a card to the Guides landing-page grid under the existing Migration tag.

Notes to reviewers

Opened as a draft: the guide documents Standalone Activities, which are publicPreview in src/constants/featureReleaseTypes.js.

All Temporal doc links are relative to satisfy Temporal.RelativeLinks. Sidekiq-specific external links (sidekiq.org) remain absolute.

Two review conventions from #5135 are already applied: core identifiers use Id (Activity Id, Run Id) with generic "user identifier", and product name is "Temporal Service".

Copilot AI balanced review requested due to automatic review settings August 28, 2026 21:12
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview Aug 28, 2026 9:14pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Ruby migration guide for converting Sidekiq jobs into Temporal Standalone Activities.

Changes:

  • Adds the Sidekiq migration tutorial.
  • Adds the guide to sidebar navigation.
  • Adds a Ruby migration card to the Guides grid.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
docs/guides/sidekiq-to-standalone-activity.mdx Adds the migration guide.
sidebars.js Adds sidebar navigation.
src/components/GuidesGrid/guides-data.json Adds the guide card.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

id: sidekiq-to-standalone-activity
title: Migrate a Sidekiq job queue to a Temporal Standalone Activity
sidebar_label: Migrate from Sidekiq
description: Migrate Sidekiq background jobs to a Temporal Standalone Activity.
- The Temporal CLI, version 1.7.0 or higher (installed in Step 2).
- An existing Sidekiq job you want to migrate, or the sample job shown in Step 4 if you are following along from scratch.

## Step 1: Set up your project directory
Comment on lines +6 to +12
keywords:
- sidekiq
- standalone activities
- ruby
- migration
- background jobs
- temporal

## Conclusion

In this tutorial, you migrated a Sidekiq job to a Temporal Standalone Activity. You converted the job into an Activity, ran a Worker to execute it, started it fire-and-forget in place of `perform_async`, retrieved a return value that Sidekiq could never give you, replaced `sidekiq_options retry:` with a Retry Policy, and inspected your Activities in place of the Sidekiq Web UI — all without writing a single Workflow. Your jobs now survive Worker crashes, retry on well-defined policies, and remain queryable through the client and Web UI.

@chris-olszewski chris-olszewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me. I do think keeping the sidekiq / activity definition as close as possible will help illustrate how straightforward this migration is.

Also passed this onto @GregoryTravis who implemented SAA in Ruby for additional 👀


Before you begin, you will need the following:

- Ruby 3.2 or higher installed on your machine (3.3 or higher is recommended, since the Worker can then run on fibers).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SAA support was only added to versions of the Ruby SDK that require 3.3 or higher

Comment on lines +163 to +165
user = get_user(input["user_id"])
deliver_email(user.email, "Welcome!")
"sent to #{user.email}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it a little odd that the activity definition doesn't match the sidekiq job. It gives the appearance of SAA needing to be handled in a special manner. Maybe having shared get_user/deliver_email helpers between the sidekiq job and activity to show that they use the same exact logic.


# --- Mock helpers -------------------------------------------------------
# Replace these with your real user lookup and mailer when you adapt this.
def get_user(user_id)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with what @chris-olszewski said above -- perhaps have a single class that incorporates the functions below as methods, and include it in both code samples, so the user could actually copy + paste the whole example and see it run.

# my_activity.rb (excerpt)
require "temporalio/error"

def execute(input)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def execute(input)
# ...
def execute(input)

Indent the method so it matches the full source from before.


def execute(input)
user = get_user(input["user_id"])
raise Temporalio::Error::ApplicationError.new(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since get_user() (above) always returns a value, and since you say that the mock deliver_email will throw, I think you can leave this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants