@@ -99,13 +99,19 @@ def wrapper(func: "TriggerFlowHandler"):
9999 self ._blue_print .chunks [handler_or_name .__name__ ] = chunk
100100 return chunk
101101
102- def create_execution (self , * , skip_exceptions : bool | None = None ):
102+ def create_execution (
103+ self ,
104+ * ,
105+ skip_exceptions : bool | None = None ,
106+ concurrency : int | None = None ,
107+ ):
103108 execution_id = uuid .uuid4 ().hex
104109 skip_exceptions = skip_exceptions if skip_exceptions is not None else self ._skip_exceptions
105110 execution = self ._blue_print .create_execution (
106111 self ,
107112 execution_id = execution_id ,
108113 skip_exceptions = skip_exceptions ,
114+ concurrency = concurrency ,
109115 )
110116 self ._executions [execution_id ] = execution
111117 return execution
@@ -118,8 +124,14 @@ def remove_execution(self, execution: "TriggerFlowExecution | str"):
118124 if execution .id in self ._executions :
119125 del self ._executions [execution .id ]
120126
121- async def async_start_execution (self , initial_value : Any , * , wait_for_result : bool = False ):
122- execution = self .create_execution ()
127+ async def async_start_execution (
128+ self ,
129+ initial_value : Any ,
130+ * ,
131+ wait_for_result : bool = False ,
132+ concurrency : int | None = None ,
133+ ):
134+ execution = self .create_execution (concurrency = concurrency )
123135 await execution .async_start (initial_value , wait_for_result = wait_for_result )
124136 return execution
125137
@@ -192,8 +204,9 @@ async def async_start(
192204 * ,
193205 wait_for_result : bool = True ,
194206 timeout : int | None = 10 ,
207+ concurrency : int | None = None ,
195208 ):
196- execution = await self .async_start_execution (initial_value )
209+ execution = await self .async_start_execution (initial_value , concurrency = concurrency )
197210 if wait_for_result :
198211 return await execution .async_get_result (timeout = timeout )
199212
@@ -202,8 +215,9 @@ def get_async_runtime_stream(
202215 initial_value : Any = None ,
203216 * ,
204217 timeout : int | None = 10 ,
218+ concurrency : int | None = None ,
205219 ):
206- execution = self .create_execution ()
220+ execution = self .create_execution (concurrency = concurrency )
207221 return execution .get_async_runtime_stream (
208222 initial_value ,
209223 timeout = timeout ,
@@ -214,8 +228,9 @@ def get_runtime_stream(
214228 initial_value : Any = None ,
215229 * ,
216230 timeout : int | None = 10 ,
231+ concurrency : int | None = None ,
217232 ):
218- execution = self .create_execution ()
233+ execution = self .create_execution (concurrency = concurrency )
219234 return execution .get_runtime_stream (
220235 initial_value ,
221236 timeout = timeout ,
0 commit comments