Unique Workflows (no overlap per user)

Yes! Indeed, there is. With Pro v1.6 you can set a global partition by workflow_name or some other unique attribute of that users workflow. (That’s really up to you). It’s more about concurrency and not uniqueness.

config :my_app, Oban,
  queues: [
    queue_name: [limit: 20, global_limit: [allowed: 1, partition: [meta: :workflow_name]]]
  ]

In this case, each node can run up to 20 jobs but only 1 of that particular workflow. It relies on you setting a distinct workflow name for each user.

Workflow.new(workflow_name: "some-workflow-#{user_id}")
5 Likes