I have a data pipeline that is reading the change feed from CosmosDB and loading the data into an external resource via Durable Functions. My start function (in Python) looks something like this:
import azure.durable_functions as df
import azure.functions as func
async def main(documents: func.DocumentList, starter: str):
client = df.DurableOrchestrationClient(starter)
instance_id = await client.start_new('MyDFOrchestrator', client_input=documents)
logging.info(f"Started orchestration ID {instance_id}")
However, this runs into an error because the cosmosDBTrigger
passes in a list of Cosmos Documents but client.start_new()
needs a JSON-serializable input value. I can get around this by shoving the list into a simple JSON object (like {"doc_list": [{doc1}, {doc2}, {doc3}]}
) but I want to make sure I'm not missing something in the API to handle this pattern.