2.0 KiB
2.0 KiB
Cliet Finder Spec
Goal
Define a client-key-based closed-loop client-finder flow with query expansion.
Input
- Raw input: free text query.
- Normalization rule: trim and remove optional
cold-outreach:prefix. - Expansion rule: generate expanded candidates and choose one
primaryQuery. - Fallback: expansion failure uses normalized raw query as
primaryQuery.
Required Inputs
client_key(workflow input, passed to runner as--client-key=<...>)querycountry(optional, defaultus)AUTH_BASE(optional runtime base URL)
Endpoint Flow (Keyword -> Run-Flow)
- Exchange runtime token
- Method:
POST - URL:
/auth/skill-credit/session - Body:
{
"clientKey": "<client_key>"
}
- Required response:
accessToken
- Query expansion
- Source:
QUERY_EXPANSION_JSON(if provided and valid)- Otherwise skill built-in rule expansion
- Required output:
expandedQueries(non-empty array)primaryQuery(non-empty string)
- If expansion fails, fallback to normalized raw query and mark fallback fields.
- Execute workflow
- Method:
POST - URL:
/ecom/cold-outreach/run-flow - Header:
Authorization: Bearer <accessToken> - Body:
{
"query": "<primaryQuery>",
"country": "us"
}
- Return accepted quickly
- Main runner returns
workflowIdwithworkflowStatus = "accepted". runIdremains empty in immediate response.
- Backend webhook delivery
- Skill runner does not poll workflow or finalize billing.
woo-data-scrawlersends terminal callback using webhook config bound on the client key.
Data Mapping Rules
- Immediate response defaults:
businessesCount = 0contactsCount = 0uniqueContactDomains = 0billingReserveStatus = "SKIPPED"billingFinalizeStatus = "SKIPPED"
Error Rules
- If no
accessToken, stop with auth error. - If expansion output is invalid/empty, fallback to raw query.
- If no
workflowIdin run response, stop with protocol error. - If runtime reports missing hook config, stop with config error.