Create dynamic group in chain with previous task result

19 views
Skip to first unread message

Mirko Artoni

unread,
Apr 22, 2024, 11:00:32 AMApr 22
to celery-users
It is possible to use the outcome of the previous action in the chain to create a group and run it within the same chain; let me explain.

Assume we have two tasks: task_A downloads a list of files and passes it to task_B, which generates a list of signatures. From that list of signatures, create a group in which I would have something like this:  

chain( task_A.si() | task_B.s() | group.from_dict.s())()

I know that .s() does not work with from_dict because it is not a celery task, but it also does not work when I use it like this:

chain( task_A.si() | group(task_B.s()))()

Is it feasible to achieve anything like this with chains and groups?
Reply all
Reply to author
Forward
0 new messages