MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / run_one

Function run_one

scripts/wharf_runner.py:207–225  ·  view source on GitHub ↗
(number: int)

Source from the content-addressed store, hash-verified

205 raise ValueError("Start independent runs outside an active execution session")
206
207 async def run_one(number: int) -> RunResult:
208 flow = WharfDemoFlow(tracing=True)
209 output, error = "", None
210 try:
211 result = await flow.kickoff_async(
212 inputs={"topic": topic, "run_number": number}
213 )
214 if not isinstance(result, str):
215 raise TypeError("Expected the Flow to return a summary string")
216 output = result
217 except Exception as exc:
218 error = f"{type(exc).__name__}: {exc}"
219 return RunResult(
220 run_number=number,
221 execution_uuid=flow.state.execution_uuid,
222 trace_id=flow.state.trace_id,
223 output=output,
224 error=error,
225 )
226
227 return await asyncio.gather(*(run_one(number) for number in range(1, runs + 1)))
228

Callers 1

run_concurrentFunction · 0.85

Calls 3

WharfDemoFlowClass · 0.85
RunResultClass · 0.85
kickoff_asyncMethod · 0.45

Tested by

no test coverage detected