@@ -211,29 +211,29 @@ def function(
211211 concurrency : ConcurrencyExpression | None = None ,
212212 input_validator : Type [TWorkflowInput ] | None = None ,
213213 ) -> Callable [[Callable [[Context ], R ]], BaseWorkflowImpl ]:
214- declaration = WorkflowDeclaration [TWorkflowInput ](
215- WorkflowConfig (
216- name = name ,
217- on_events = on_events ,
218- on_crons = on_crons ,
219- version = version ,
220- timeout = timeout ,
221- schedule_timeout = schedule_timeout ,
222- sticky = sticky ,
223- default_priority = default_priority ,
224- concurrency = concurrency ,
225- input_validator = input_validator
226- or cast (Type [TWorkflowInput ], EmptyModel ),
227- ),
228- self ,
229- )
230-
231214 def inner (func : Callable [[Context ], R ]) -> BaseWorkflowImpl :
215+ declaration = WorkflowDeclaration [TWorkflowInput ](
216+ WorkflowConfig (
217+ name = name or func .__name__ ,
218+ on_events = on_events ,
219+ on_crons = on_crons ,
220+ version = version ,
221+ timeout = timeout ,
222+ schedule_timeout = schedule_timeout ,
223+ sticky = sticky ,
224+ default_priority = default_priority ,
225+ concurrency = concurrency ,
226+ input_validator = input_validator
227+ or cast (Type [TWorkflowInput ], EmptyModel ),
228+ ),
229+ self ,
230+ )
231+
232232 class Workflow (BaseWorkflowImpl ):
233233 config = declaration .config
234234
235235 @self .step (
236- name = name ,
236+ name = declaration . config . name ,
237237 timeout = timeout ,
238238 retries = 0 ,
239239 rate_limits = [],
0 commit comments