Complete the code to start a Durable Function orchestration.
client = df.DurableOrchestrationClient(context) instance_id = await client.[1]("MyOrchestrator", input_data)
The start_new method starts a new orchestration instance in Durable Functions.
Complete the code to define an activity function in Durable Functions.
@df.activity_trigger async def [1](name: str) -> str: return f"Hello, {name}!"
The function name for an activity can be any valid name, but here greeting_activity clearly indicates an activity function.
Fix the error in the orchestrator function to call an activity function.
def orchestrator_function(context: df.DurableOrchestrationContext): result = yield context.[1]("greeting_activity", "Azure") return result
The correct method to call an activity function inside an orchestrator is call_activity.
Fill both blanks to correctly wait for an orchestration to complete and get its status.
status = await client.[1](instance_id) result = await client.[2](instance_id)
The method wait_for_completion waits for orchestration completion, and get_status retrieves the current status.
Fill all three blanks to correctly define an orchestrator function that calls two activities sequentially.
def [1](context: df.DurableOrchestrationContext): result1 = yield context.[2]("activity_one", None) result2 = yield context.[3]("activity_two", result1) return result2
The orchestrator function is named orchestrator_function. It calls activities using call_activity method for both calls.