I see in the python sdk that “Each Worker Entity polling the same Task Queue must be registered with the same Workflow Types and Activity Types.”
Does this mean this is illegal because two different worker entities are polling the same task queue but the second worker also operates on Workflow?
async with Worker(
client,
task_queue=task_queue_priority,
activities=[heavy_activity]
):
...
async with Worker(
client,
task_queue=task_queue_secondary,
activities=[heavy_activity],
workflows=[Workflow]
):
...
I think I understand more from this:
If a Worker polls a Task for a Workflow Type or Activity Type it does not know about, it fails that Task. However, the failure of the Task does not cause the associated Workflow Execution to fail.
They do need the same types registered, but if there are 0 activities or workflows registered, that’s ok because it doesn’t start that worker type and poll for that work at all. Workers are basically two completely separate things: activity workers and workflow workers. If there are no activities, the activity worker doesn’t even start (same for workflows). So if you have any activities you need to have the same ones as are registered in other activity workers, but you can also have no activities which means it will only process workflows and activities don’t apply (all of that applies similarly for workflows).
So in your first snippet, that first worker won’t process workflows at all so you won’t get any unknown-workflow errors from it.
1 Like