diff --git a/openhands-workflow-with-verification.json b/openhands-workflow-with-verification.json index 4fbde09..a704ef4 100644 --- a/openhands-workflow-with-verification.json +++ b/openhands-workflow-with-verification.json @@ -11,7 +11,7 @@ }, { "parameters": { - "jsCode": "// Initialize workflow static data\nif (!$workflow.staticData.retries) {\n $workflow.staticData.retries = 0;\n}\n\nreturn {\n initialized: true,\n timestamp: new Date().toISOString()\n};" + "jsCode": "// Initialize retry counter in workflow data\nreturn {\n retry_count: 0,\n max_retries: 15,\n initialized: true,\n timestamp: new Date().toISOString()\n};" }, "id": "init-workflow", "name": "Initialize Workflow", @@ -155,7 +155,7 @@ }, { "parameters": { - "jsCode": "// Retry counter with max retries\nconst retries = $workflow.staticData.retries || 0;\nconst maxRetries = 15; // 15 * 15s = ~4 minutes\n\nif (retries >= maxRetries) {\n throw new Error('Timeout: Agent did not start within 4 minutes');\n}\n\n$workflow.staticData.retries = retries + 1;\n\nconst convId = $('1. Create Conversation').item.json.conversation_id;\n\nreturn {\n conversation_id: convId,\n retry_count: retries + 1\n};" + "jsCode": "// Get retry count from input or default to 0\nconst currentRetries = $input.item.json.retry_count || 0;\nconst maxRetries = 15; // 15 * 15s = ~4 minutes\n\nif (currentRetries >= maxRetries) {\n throw new Error('Timeout: Agent did not start within 4 minutes');\n}\n\nconst convId = $('1. Create Conversation').item.json.conversation_id;\n\nreturn {\n conversation_id: convId,\n retry_count: currentRetries + 1\n};" }, "id": "retry-counter", "name": "Retry Counter",