Azure Functions with Durable Functions: How to Handle Long-Running Processes in Node.js Without Timeouts?
I'm currently implementing an Azure Function that uses Durable Functions in Node.js to manage a long-running workflow. My goal is to handle a process that can take several hours, but I'm working with timeout issues that are causing my orchestrator function to terminate unexpectedly. I have set up my orchestrator like this: ```javascript const df = require('durable-functions'); module.exports = df.orchestrator(function* (context) { const output = yield context.df.callActivity('LongRunningActivity', null); return output; }); ``` In my `LongRunningActivity`, I've implemented a delay to simulate long processing, using `await new Promise(resolve => setTimeout(resolve, 3600000));` which is supposed to wait for an hour. However, after approximately 10 minutes, I see logs indicating that the orchestrator is timing out with the following behavior message: ``` Function 'OrchestratorFunctionName' failed: The function execution was aborted because it took too long. ``` I've already confirmed that the `FUNCTIONS_WORKER_TIMEOUT` setting is set to `00:60:00` in my `host.json`, which should allow up to an hour of execution, but it seems that the orchestrator is still not able to handle long-running processes effectively. I've tried moving to `context.df.createTimer(context.df.now().addHours(1))` to create a timer within the orchestrator, but that caused a different set of issues where the orchestration never returned the correct output. I'm looking for guidance on how to keep my orchestrator alive during lengthy processes and ensure that it can handle timeouts effectively without losing state or causing errors. What best practices should I be following with Durable Functions in this scenario? Any insight would be greatly appreciated!