Description:
Use Case
I need to orchestrate multiple AI agents that work sequentially, where each agent builds upon the previous agent’s work:
-
Agent 1: Takes input, processes it, creates JSON output
-
Agent 2: Gets output from Agent 1, uses additional tools for enrichment
-
Agents 3, 4, 5: Use inputs from prior stages to create their outputs
-
Agent 6: Collects all inputs from prior agents and creates final output
Why This Approach?
I separated the work into multiple agents instead of using a single prompt because:
-
Model accuracy: A single prompt handling all tasks caused excessive tool calling and back-and-forth, leading to many mistakes
-
Timeout issues: AIP Logic’s default 5-minute timeout caused the function to timeout 90% of the time
Current Problem
Approach 1: AIP Logic Orchestrating Agent Functions
Using a single AIP Logic function that calls all agents as functions via tool calls still hits the 5-minute timeout limit, since each agent takes ~2 minutes to execute.
Approach 2: TypeScript v2 Function Orchestration
I attempted to use a TypeScript v2 function to orchestrate all agents:
-
Live Preview: The function successfully ran for 15 minutes in live preview (possibly because it was running in Code Workspaces?)
-
Configuration: I was able to set the timeout to 1200 seconds (20 minutes) and save it in the function configuration page
-
Production Issue: When wired to an action and executed, I get:
Unknown Server Error
Error: [Default] Internal
Error ID: e61c764a-793f-4d58-8e5d-fac9e0d98ac4
Documentation Discrepancy
The documentation states that preview mode only allows 280 seconds, but I observed 15-minute executions in Code Workspaces.
Questions
-
What is the actual maximum timeout for TypeScript v2 functions in production (non-preview) mode?
-
What is the recommended architecture for multi-agent orchestration workflows that require >5 minutes of execution time?
-
Is there a workaround for the timeout limitations when orchestrating multiple AI agents?
-
Are there alternative patterns (e.g., async workflows, webhooks, scheduled jobs) that would better support this use case?
Environment
-
Function Type: TypeScript v2
-
Execution Context: Ontology Action
-
Total Expected Runtime: ~12-15 minutes (6 agents × 2 minutes each)