Hi Veronika
Mike's suggestion is correct.
You need to create a static method in your class with LT_AGENTS of type TSWHACTOR (table with agents)as exporting and few input parameters based on your requirement. when you will create a task it will create a corresponding elements in task and WF container.. Just link the binding and assign LT_AGENTS as suggested by Mike Pokraka .
Refer to Link below -
Regards
Sandy