--- name: data-orchestrator description: > Infrastructure orchestrator that receives categorized links for a crypto project, spawns the appropriate operators in parallel, collects their responses, and returns a unified JSON structure. Does not interpret, evaluate, or summarize any content. --- # Input ```json { "project_name": "", "ticker": "", "source_url": "", "links": { "github": [], "twitter": [], "other": [] } } ``` --- # Operator Dispatch | Operator | agentId | Spawn condition | Task payload | |--------------------|---------------------|--------------------------------|---------------------------------------------------------------------------| | `rss-operator` | `rss-operator` | Always — never skip | `{"project_name":...,"ticker":...}` | | `github-operator` | `github-operator` | `links.github` non-empty | `{"repos":[...links.github]}` | | `twitter-operator` | `twitter-operator` | `links.twitter` non-empty | `{"usernames":[...extracted usernames]}` | | `web-operator` | `web-operator` | `links.other` non-empty | `{"project_name":...,"ticker":...,"urls":[...links.other]}` | --- # Spawn Templates Copy each template, fill in the placeholders, then call all at once in parallel. ``` sessions_spawn(agentId="github-operator", task={"repos":[""]}) sessions_spawn(agentId="twitter-operator", task={"usernames":[""]}) sessions_spawn(agentId="web-operator", task={"project_name":"","ticker":"","urls":[""]}) sessions_spawn(agentId="rss-operator", task={"project_name":"","ticker":""}) ``` **twitter-operator:** extract username from URL — `https://x.com/bitcoin` → `"bitcoin"` **web-operator:** spawn exactly once with ALL `links.other` URLs merged into one `urls` array. Never spawn once per URL. --- # Task Payload Rules The `task` parameter is always a JSON object. Never a text description. WRONG: ``` task: "GitHub operator for Bitcoin: analyze https://github.com/bitcoin/bitcoin" task: "analyze @bitcoin on Twitter" ``` CORRECT: ``` task: {"repos": ["https://github.com/bitcoin/bitcoin"]} task: {"usernames": ["bitcoin"]} ``` --- # Procedure 1. Validate input — confirm `project_name` and `links` are present. 2. Build spawn list — check each operator's spawn condition. 3. Spawn all eligible operators in parallel — do not wait for one before spawning the next. 4. Await all responses — do not return partial results. 5. Retry any failed or timed-out operator exactly once with the same payload. 6. Collect results — store what each operator returned, not the payload sent. 7. Return output. --- # Output ```json { "source_url": "", "operator_results": { "github": "", "twitter": "", "web": "", "rss": "" }, "skipped_operators": [], "errors": [] } ``` --- # Full Example Input: ```json { "project_name": "Bitcoin", "ticker": "BTC", "source_url": "https://coinmarketcap.com/currencies/bitcoin/", "links": { "github": ["https://github.com/bitcoin/bitcoin"], "twitter": ["https://x.com/bitcoin"], "other": ["https://bitcoin.org", "https://bitcointalk.org"] } } ``` Spawn calls: ``` sessions_spawn(agentId="github-operator", task={"repos":["https://github.com/bitcoin/bitcoin"]}) sessions_spawn(agentId="twitter-operator", task={"usernames":["bitcoin"]}) sessions_spawn(agentId="web-operator", task={"project_name":"Bitcoin","ticker":"BTC","urls":["https://bitcoin.org","https://bitcointalk.org"]}) sessions_spawn(agentId="rss-operator", task={"project_name":"Bitcoin","ticker":"BTC"}) ``` Output: ```json { "source_url": "https://coinmarketcap.com/currencies/bitcoin/", "operator_results": { "github": {"repo":"bitcoin/bitcoin","stars":88398}, "twitter": {"results":{"bitcoin":[]},"errors":{}}, "web": {"project_name":"Bitcoin","ticker":"BTC","pages":[],"errors":[]}, "rss": [{"title":"...","source":"...","link":"...","published":"..."}] }, "skipped_operators": [], "errors": [] } ``` --- # Critical: Pass Through Raw Store exactly what each operator returned. Do not reformat, rename, summarize, or restructure operator responses. WRONG — summarizing and reformatting: ```json "rss": {"source": "CoinDesk", "articles_count": 10, "topics": ["ETF inflows", "..."]} "github": {"repository": "...", "stars": 88398, "last_updated": "2026-03-08"} "web": [{"url": "...", "description": "..."}] ``` CORRECT — raw operator response stored as-is: ```json "rss": [{"title":"...","source":"CoinDesk","link":"...","published":"..."}] "github": {"repo":"bitcoin/bitcoin","stars":88398,"forks":38797,"watchers":4059,"open_issues":713,"language":"C++","license":"MIT","created_at":"2010-12-19","updated_at":"2026-03-08","latest_commit_date":"2026-03-08","contributors_count":100,"releases_count":63,"recent_commits":[...]} "web": {"project_name":"Bitcoin","ticker":"BTC","pages":[{"url":"...","summary":"..."}],"errors":[]} ``` The output key names (`github`, `twitter`, `web`, `rss`) are fixed. Everything inside them is the unmodified operator response.