Do folks typically organize their tasks in separat...
# ask-community
c
Do folks typically organize their tasks in separate files and then import them into their flows as needed? For example, there are some general tasks that I would most likely use in multiple flows so they do not need to be defined and attached to a particular flow. Curious about this as I see a lot of examples of tasks always being defined within the flow.
d
The answer is yes. If same code is being used alot - we have common task grouped into a single module.
upvote 1
c
@Deceivious gotchya- thanks for confirming
d
dont forget to abuse
with_options
method
c
hmmm, just reading up on it- haven’t seen it before. Any important use cases for using this? Just off the top of my head I can see how it’s good for clarity if you’re using a task in multiple flows and updating the name for its particular use case?
d
Using different caches / retries / other prefect features for task decorated methods depending on needs of the flow.
c
right right!