---
title: "Generate a tree via Temporal (parallel endpoint for A/B comparison)"
method: POST
path: "/context-documents/tree-temporal"
tags: ["Context Documents"]
---

# Generate a tree via Temporal (parallel endpoint for A/B comparison)

`POST /context-documents/tree-temporal`

Same contract as `POST /context-documents/tree` but always dispatches
via Temporal — no PostHog flag, no legacy fallback.

Exists so the legacy and Temporal paths can be exercised side-by-side
against the same app data and their outputs compared. The progress
endpoint (`GET /context-documents/tree/{tree_id}/progress`) works for
both since both write to the same `ContextDocTree` table.

## Request body

- TreeGenerateRequest — Request body for POST /context-documents/tree.
  - `sources` string[], nullable — Integration sources to include (e.g., ['gmail', 'slack']). Defaults to all.
  - `user_id` string, nullable — User ID for personal tier scoping. When set, personal/context.md is generated from this user's data only. Company and workstream tiers still use all data.
  - `workstream_name` string, nullable — Generate docs for this workstream only (skip auto-detection).

## Response `200`

Successful Response

- TreeGenerateResponse
  - `tree_id` string, required
  - `status` string, required
  - `created_at` string, date-time, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-04-25** `0b9bf804b7e6` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/hyperspell/apis/hyperspell-api/changes/context-documents/tree-temporal/post.md)

---

[API](https://skmtc.dev/hyperspell/apis/hyperspell-api.md) · [All operations](https://skmtc.dev/hyperspell/apis/hyperspell-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hyperspell/hyperspell-api/revisions/023174b0253c/schema)
