Skip to content

Add workflows command for reusable deep research templates#70

Merged
yorkeccak merged 1 commit into
mainfrom
feature/deepresearch-workflows
Jun 23, 2026
Merged

Add workflows command for reusable deep research templates#70
yorkeccak merged 1 commit into
mainfrom
feature/deepresearch-workflows

Conversation

@yorkeccak

@yorkeccak yorkeccak commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new valyu workflows command for reusable, versioned deep research templates. A workflow is a saved prompt, research strategy, report format, deliverables, and recommended mode with typed {variables}. Fill in the variables and run one to start a normal deep research task - same auth, billing, and lifecycle as a freeform task.

Two scopes: curated Valyu templates available to everyone (read-only), and org templates each organization creates and versions privately.

Command surface

valyu workflows
├── list [--vertical --scope --search --tag --limit --expand]   discover templates
├── get <slug> [--version N]                                    full template detail + variables
├── versions <slug>                                             version history
├── preview <slug> [--param k=v ...]                            resolve template, no credits spent
├── run <slug> [--param k=v ...] [-m mode] [--version N] [-w]   run -> starts a deepresearch task
├── create --file <path>                                        create an org template (JSON)
├── update <slug> --file <path>                                 edit metadata / publish a new version
└── delete <slug> [-y]                                          delete an org template

run reuses the existing deepresearch watch loop, so --watch streams progress and valyu deepresearch status/watch <id> track it like any other task.

Implementation

  • src/commands/workflows/index.ts - the new command (8 subcommands).
  • src/lib/client.ts - workflow client methods + types; adds a PATCH helper to the request layer.
  • src/cli.ts - registers the command and adds a top-level example.
  • src/commands/deepresearch/index.ts - exports watchResearch for reuse by workflows run.
  • Docs: README section, SKILL.md command tree/table, new skills/valyu-cli/references/workflows.md.
  • Version bumped to 1.1.0 (package.json, version.ts, SKILL synced).

Testing

  • pnpm build / pnpm typecheck / pnpm test all pass (45 tests, 9 new covering the workflow client methods, query-string building, PATCH/DELETE verbs, and run-override behaviour).
  • Live-tested against the production API: listed all curated templates, verified get / versions / preview response shapes, and ran a real workflow (fast mode) end-to-end which created a task with the expected workflow linkage, then cancelled it.

Notes for reviewers

  • Param values from --param key=value are coerced to number/boolean when they look like one; --params-file (or --params-file - for stdin) preserves exact JSON for awkward values.
  • Slugs are URL-encoded in paths to support org-prefixed (org/name) slugs.
  • run only forwards overrides (mode, version, webhook, alert-email) when explicitly provided, so a template's own recommended mode and output formats apply by default.

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Workflows are versioned, templated deep research starting points: a saved
prompt, research strategy, report format, deliverables, and recommended
mode with typed variables. Fill in the variables and run one to start a
normal deep research task - same auth, billing, and lifecycle.

New `valyu workflows` command:
- list / get / versions    discover curated and org-owned templates
- preview                  resolve a template against params (no credits spent)
- run                      run a template, with optional mode/version overrides and --watch
- create / update / delete manage org-owned templates from JSON definitions

Adds the matching client methods and types, a SKILL reference, README
section, and client tests. Bumps the CLI to 1.1.0.
@yorkeccak yorkeccak merged commit d11b469 into main Jun 23, 2026
1 check passed
@yorkeccak yorkeccak deleted the feature/deepresearch-workflows branch June 23, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant