TAP workflows
TAP Workflows
TAP tagging now has a TAP-facing tool route, POST /tap/tools/tagging-suggestions, for synchronous suggestions-only calls. The older custom workflow routes remain available for compatibility and tracked-run debugging. The legacy batch tagging and batch caption-update workflows are no longer exported through the generic workflow route registry.
TAP topic detection is an internal completed-conversation workflow. External TAP integration should call the tool route, POST /tap/tools/topic-detection, which runs the workflow synchronously and returns the standard { data } envelope. The generic workflow route remains an internal implementation/testing path. Scheduled polling of TAP conversations is not wired yet.
Route Quick Reference
- Tagging suggestions —
POST /tap/tools/tagging-suggestionsfor product-facing sync calls;POST /tap/workflows/tagging-suggestions, pluscreate-run,start, andruns/{runId}tracked run routes for compatibility/debugging. - TAP query compatibility route —
POST /tap/workflows/query. - TAP query async compatibility routes —
start-async,create-run,start, andruns/{runId}are deliberately retired and return410; use the bounded synchronous route. - Content safety —
POST /tap/tools/content-safetyfor the product tool; the registered generic workflow route is available for internal execution. - Topic detection —
POST /tap/tools/topic-detectionfor the product-facing on-demand classification run;POST /tap/workflows/topic-detectionremains an internal workflow route.
loadTapArtifacts() currently registers three agents, three active product
tools, and three workflows: TAP content safety, TAP topic detection, and the
platform-owned recoveredAnalysisWorkflow compatibility workflow. Tagging and
query are supplemental custom routes rather than generic workflow-registry
entries.
Tagging Suggestions
The tagging suggestions tool accepts post context and media from TAP and returns suggested tags plus optional captions. It does not call TAP APIs and does not update TAP posts.
The implementation uses:
packages/domain-tap/src/routes/tap-tagging-suggestions.routes.tspackages/domain-tap/src/services/tap-tagging-suggestions.service.tspackages/domain-tap/src/agents/tap-caption-tagging-agent.ts
TAP platform auth/write credentials are not required for the tagging suggestions path.
Topic Detection
The topic detection workflow classifies completed or quiet TAP conversations into topic keys from the active taxonomy. It uses local gates and candidate ranking before calling tap-topic-detection-agent.
The workflow supports two analysis modes:
fast— sends a compact prompt with conversation context and top candidate topic options.full— sends conversation context, the full taxonomy, and ranked candidates.
Both modes return and persist the same audit data: final topics, message-level findings, evidence message IDs, provider request ID, provider latency, token usage, workflow step timings, raw agent response, and validation errors.
Valid topic-detection requests keep HTTP 200 semantics. Provider rate limits and local provider timeouts are surfaced in the workflow body with status: "failed", classifierStatus: "failed", optional provider diagnostics, and optional retry metadata instead of relying on transport-level failures. Responses also include an inputSummary with message count, context truncation status, included message count, context size, and the configured context limit.
Tagging suggestions also keep HTTP 200 for valid partial results. Failed or skipped media processing is surfaced per result with reason, retryable, and mediaDiagnostics, plus an aggregate summary.
For product-facing dry-run testing, call:
POST /tap/tools/topic-detection
The tool route returns { "data": { ...workflow result... } }.
For internal workflow debugging, call:
POST /tap/workflows/topic-detection
with a flat workflow body containing conversationId, messages, dryRun, and optional analysisMode. The internal sync endpoint returns a wrapper with runId, status, and result.
The implementation uses:
packages/domain-tap/src/workflows/tap/topic-detection/topic-detection.workflow.tspackages/domain-tap/src/services/tap-topic-detection.service.tspackages/domain-tap/src/services/tap-topic-detection-persistence.tspackages/domain-tap/src/agents/tap-topic-detection-agent.ts