Create a test script
hello_message_flow.py
contains a function build_hello_message_flow
, decorated with @flow
, which returns the Flow
object you want to test.Compile the flow
CompiledFlow
instance, which you can use to start a flow run. Use compile_deploy()
to compile and deploy the flow.compile()
instead.Start a run
CompiledFlow
object. Depending on your needs, you can choose from the following approaches:A simple client
CompiledFlow.invoke()
to start the flow. You can optionally pass input data.Using event handlers
invoke()
for more control over flow completion and error handling.Processing raw events
invoke_events()
, which returns an asynchronous iterator yielding (FlowEvent
, FlowRun
) tuples.FlowEventType
and TaskEventType
in ibm_watsonx_orchestrate.experimental.flow_builder.types
.