Back to Prompt Library
implementation
Orchestrate Workflow with Temporal.io
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: AI Market Trend & Strategy Advisor
Format
Text-first
Lines
6
Sections
2
Linked challenge
AI Market Trend & Strategy Advisor
Prompt source
Original prompt text with formatting preserved for inspection.
6 lines
2 sections
No variables
4 checklist items
Design a Temporal.io workflow in TypeScript that orchestrates the agent's tasks. This workflow should: 1. Periodically (e.g., daily) trigger the `fetchMarketData` tool for 'memory_chips' and 'ai_tools'. 2. Pass the fetched data to the Mastra AI agent for analysis using Qwen 3. 3. Store the generated analysis and recommendations in Supabase. 4. Handle potential API failures with retries. Provide the `workflow.ts` and `activities.ts` code, showing how you call the Mastra agent and interact with Supabase within a Temporal workflow. Assume `SupabaseClient` is available in `activities.ts`.
Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.