{"id":50564372,"url":"https://github.com/marcusschiesser/spring-temporal-ai-workflow-patterns","last_synced_at":"2026-06-04T13:30:24.624Z","repository":{"id":351985523,"uuid":"1213348018","full_name":"marcusschiesser/spring-temporal-ai-workflow-patterns","owner":"marcusschiesser","description":"Durable AI Workflows with Spring + Temporal","archived":false,"fork":false,"pushed_at":"2026-04-17T10:19:45.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-21T15:51:57.676Z","etag":null,"topics":["ai","java","spring","temporal"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcusschiesser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-17T09:33:14.000Z","updated_at":"2026-04-17T10:21:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/marcusschiesser/spring-temporal-ai-workflow-patterns","commit_stats":null,"previous_names":["marcusschiesser/spring-temporal-ai-workflow-patterns"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcusschiesser/spring-temporal-ai-workflow-patterns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusschiesser%2Fspring-temporal-ai-workflow-patterns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusschiesser%2Fspring-temporal-ai-workflow-patterns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusschiesser%2Fspring-temporal-ai-workflow-patterns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusschiesser%2Fspring-temporal-ai-workflow-patterns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcusschiesser","download_url":"https://codeload.github.com/marcusschiesser/spring-temporal-ai-workflow-patterns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusschiesser%2Fspring-temporal-ai-workflow-patterns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33907692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","java","spring","temporal"],"created_at":"2026-06-04T13:30:23.770Z","updated_at":"2026-06-04T13:30:24.613Z","avatar_url":"https://github.com/marcusschiesser.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Temporal AI Workflow Patterns\n\nSpring Boot port of the Vercel `ai-sdk-workflow-patterns` example using:\n\n- Temporal Java SDK for durable orchestration\n- Spring AI with OpenAI\n- A small web launcher UI plus REST endpoints\n- Docker Compose for local app + Temporal + PostgreSQL + Temporal UI\n\n## What It Includes\n\nThe app implements five workflow patterns:\n\n- [Sequential processing](src/main/java/com/example/ai/workflow/SequentialWorkflowImpl.java): fixed ordered steps where one output feeds the next\n- [Parallel processing](src/main/java/com/example/ai/workflow/ParallelWorkflowImpl.java): independent tasks run at the same time and are aggregated afterward\n- [Routing](src/main/java/com/example/ai/workflow/RoutingWorkflowImpl.java): an initial classification step chooses the next model, prompt, or path\n- [Evaluator-optimizer](src/main/java/com/example/ai/workflow/EvaluatorWorkflowImpl.java): a result is generated, evaluated, and improved until it passes a threshold or reaches a limit\n- [Orchestrator-worker](src/main/java/com/example/ai/workflow/OrchestratorWorkflowImpl.java): a planner breaks work into subtasks and specialized workers execute them\n\nThe browser UI at `http://localhost:8081/` lets you:\n\n1. Choose one of the workflow patterns\n2. Start it with sample input\n3. Open the specific run directly in Temporal UI\n\n## Pattern Guide\n\nThese labels follow the AI SDK workflow patterns guide:\n\n- Sequential processing is the simplest chain. Use it when the task has a clear sequence of steps.\n- Routing is useful when different kinds of input need different prompts, models, or handling paths.\n- Parallel processing is useful when multiple independent analyses can happen simultaneously.\n- Orchestrator-worker is useful when one model should plan and several specialized workers should execute pieces of the work.\n- Evaluator-optimizer is useful when quality matters enough to justify an evaluation and rewrite loop.\n\n## Requirements\n\n- Java 21\n- Docker with Docker Compose\n- `OPENAI_API_KEY` set in your environment\n\n## Run With Docker Compose\n\nStart the full stack:\n\n```bash\ndocker compose up -d --build\n```\n\nServices:\n\n- App UI and API: `http://localhost:8081`\n- Temporal UI: `http://localhost:8080`\n- Temporal gRPC: `localhost:7233`\n- PostgreSQL: `localhost:5432`\n\nStop the stack:\n\n```bash\ndocker compose down\n```\n\n## Run Locally Without Docker\n\nYou need a Temporal server available on `127.0.0.1:7233` or set `TEMPORAL_TARGET`.\n\nThen run:\n\n```bash\n./gradlew bootRun\n```\n\n## Configuration\n\nPrimary environment variables:\n\n- `OPENAI_API_KEY`\n- `TEMPORAL_TARGET`\n- `TEMPORAL_NAMESPACE`\n- `TEMPORAL_TASK_QUEUE`\n- `TEMPORAL_UI_BASE_URL`\n- `APP_AI_MODEL_SMALL`\n- `APP_AI_MODEL_DEFAULT`\n- `APP_AI_MODEL_STRONG`\n\nDefaults are defined in [src/main/resources/application.yml](src/main/resources/application.yml).\n\n## API\n\nStart a workflow with sample input:\n\n```bash\ncurl -X POST 'http://localhost:8081/api/workflows/sequential/start?useSampleInput=true'\n```\n\nExample response:\n\n```json\n{\n  \"pattern\": \"SEQUENTIAL\",\n  \"workflowId\": \"sequential-42d5c345-e795-494c-8661-cbf0d4474c96\",\n  \"runId\": \"019d9abe-3845-7d16-aac8-038633607e07\",\n  \"temporalUiUrl\": \"http://localhost:8080/namespaces/default/workflows/sequential-42d5c345-e795-494c-8661-cbf0d4474c96/019d9abe-3845-7d16-aac8-038633607e07/timeline\"\n}\n```\n\nCheck workflow status:\n\n```bash\ncurl 'http://localhost:8081/api/workflows/\u003cworkflowId\u003e'\n```\n\n## Development\n\nRun tests:\n\n```bash\n./gradlew test\n```\n\nKey areas:\n\n- Workflow contracts and implementations: `src/main/java/com/example/ai/workflow`\n- AI activity layer: `src/main/java/com/example/ai/activity`\n- REST API: `src/main/java/com/example/ai/api`\n- Launcher UI: `src/main/resources/static/index.html`\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcusschiesser%2Fspring-temporal-ai-workflow-patterns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcusschiesser%2Fspring-temporal-ai-workflow-patterns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcusschiesser%2Fspring-temporal-ai-workflow-patterns/lists"}