mauzybwy
Environment
- Oban Pro: 1.6.2
- Oban: 2.19.4
The Issue
I have some workflows IngestionWorkflow and MapperWorkflow, each of which looks something like this:
defmodule MapperWorkflow do
def build(source_name, opts \\ []) do
# ...
Workflow.new()
|> Workflow.put_context(%{
source_name: to_string(source_name),
batch_size: batch_size,
since: since
})
|> Workflow.add_graft(:mappers, &graft_mappers/1)
|> Workflow.add_cascade(:summarize, &summarize/1,
deps: :mappers,
queue: :external_content_ingestion,
recorded: true
)
end
end
I also have an orchestration workflow which works like this:
Workflow.new()
|> Workflow.add_workflow(
:ingestion_workflow,
IngestionWorkflow.build(source_name, opts)
)
|> Workflow.add_workflow(
:mapper_workflow,
MapperWorkflow.build(source_name, opts),
deps: [:ingestion_workflow]
)
|> Oban.insert_all()
Each of the sub-workflows work perfectly fine on their own, but when run from the orchestration, I get this error:
** (RuntimeError) module is not a worker: Oban.Pro.Workers.Context
I assume this has something to do with the fact that Oban.Pro.Workers.Context is a virtual module registered like: Job{worker: Oban.Pro.Workers.Context}
I can kinda work around this by grafting in the workflow, but that shouldn’t be necessary, and it would be better to be able to use the sub-workflows via add_workflow/4
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
sorentwo
You’re correct. The Context job is virtual and shouldn’t ever run.
Are you seeing this issue in testing, or when running the jobs normally? We’ll take a look into it either way, but there are semantic differences
mauzybwy
I am seeing this issue in testing. I actually do not believe it appears when running the job normally, but I have refactored the child workflows to do something like this:
And just make sure I have the orchestration workflow set the correct context. I can un-refactor it if you want me to check the difference between test/dev environments, but I do recall it works fine outside of test.
sorentwo
Are you testing with
inlinemode? If so, that would cause a problem. Workflows aren’t really compatible with inline mode because the jobs never hit the database. They are executed in memory in insert order, which doesn’t exercise the workflow dependencies at all.Testing workflows should be done with the
run_workflow/1Pro testing helper, or manual draining frommanualtesting mode if needed.mauzybwy
I am testing in
:manualmode. An example test setup looks something like this:Sub-workflows have been tested and work correctly like so:
I’ll give
run_workflow/1a shot real quick and see if it solves the issuemauzybwy
Okay I tried
run_workflow/1and also re-checked indevmode with my workaround removed. Both cases actually act identical to testing in:manualmode withdrain_jobs/1.I.E.:
** (RuntimeError) module is not a worker: Oban.Pro.Workers.ContextWhen actually trying this out at runtime in
devmode, the workflow actually runs correctly, but theMapperWorkflow’sOban.Pro.Workers.Contextfails with the followingmeta:The
MapperWorkflowthen continues on to work correctly, I assume with the parent’s context (though I haven’t validated whether that is true)sorentwo
Thanks for investigating and confirming it’s the same result with
run_workflow. We’ll get it fixedsorentwo
Update on this—we were able to reproduce the issue and there’s a fix on main ready to go out with the next patch. Thanks again for such detailed investigation work!
mauzybwy
Great stuff thanks for looking into it!