Wrapping up a class

Hi, I’m trying to wrap a class with the flow, like this:

class Algorigthm:

   @task
   def do_first(self, something):
      ....
  
   @task
   def do_second(self, something_else):
      ....

   @flow
   def start_flow(self):
      do_first(..)
      do_second(..)

But it asks me to provide “self”, otherwise, if i do provide the object itself, it gives me a recursion error.
would like to get help.

What are you trying to do? A flow must be a function rather than a class method. But you can call that class and all its methods directly from the flow function. Check out the examples in docs.prefect.io

1 Like