4.0 KiB
Client Finder
Use skill-credit + ecom run-flow so agents only need workflow input client_key.
This skill includes query expansion before calling /ecom/cold-outreach/run-flow.
Execution mode is fire-and-return: start workflow fast and return accepted immediately; terminal callbacks are handled by backend webhook delivery.
Run Skill
Run the skill runner (primary entrypoint agents should call):
<skill-dir>/scripts/cliet-finder.sh --client-key='<sk_xxx.yyy>' "office machine" "us"
Optional: provide LLM-generated query expansion JSON. If provided, it must be valid and non-empty:
QUERY_EXPANSION_JSON='{"expandedQueries":["office machine supplier us","office equipment distributor us"],"primaryQuery":"office machine supplier us"}' \
<skill-dir>/scripts/cliet-finder.sh --client-key='<sk_xxx.yyy>' "office machine" "us"
Use dry-run to verify endpoint sequence without network calls:
<skill-dir>/scripts/cliet-finder.sh --client-key='<sk_xxx.yyy>' "office machine" "us" --dry-run
Quick Test
Run the test wrapper (it calls the skill runner above):
<skill-dir>/scripts/run-endpoint-test.sh "office machine" "us"
Default behavior is --dry-run. For live execution, pass mode + client key as 3rd/4th args.
<skill-dir>/scripts/run-endpoint-test.sh "office machine" "us" --dry-run
<skill-dir>/scripts/run-endpoint-test.sh "office machine" "us" --live "sk_xxx.yyy"
Required Inputs
For live execution:
client_keyfrom workflow input (pass into script as--client-key=<client_key>)query(string)country(optional, defaultus)
Optional runtime config:
AUTH_BASE(default:https://api-gw-test.yuanwei-lnc.com, can be passed as--auth-base=<url>)
Optional:
QUERY_EXPANSION_JSON(optional LLM expansion input)
Reference
Load and follow references/cliet-finder.md as the detailed workflow spec. For expansion behavior, also follow references/query-expansion-spec.md. For client onboarding and billing flow (Chinese), read how-to-use.md.
Execution Checklist
- Normalize input query.
- Trim whitespace.
- Remove leading
cold-outreach:prefix (case-insensitive).
- Exchange runtime token.
- Call
POST /auth/skill-credit/sessionwith{ "clientKey": "<client_key>" }. - Require
accessTokenin response.
- Expand query.
- Build candidate queries from skill logic (
rule) orQUERY_EXPANSION_JSON(llm). - Select one
primaryQuery. - Fallback policy: if expansion fails, use normalized raw query as
primaryQueryand continue.
- Execute workflow.
- Call
POST /ecom/cold-outreach/run-flowwith runtimeaccessToken:query=primaryQuerycountry
- Require
workflowIdin response. - This workflow only covers discovery + email-find data collection.
- Return accepted immediately.
- Return JSON with
workflowStatus = "accepted"andworkflowId. - This runner does not poll or finalize billing.
- Backend pushes terminal callback to webhook bound on the client key.
Output Contract (Strict)
- Final answer must be JSON only. No prose, no markdown table, no repeated preface.
- Follow
output_schema.jsonexactly. errorisnullwhen success; short string when failed.- If fallback is used, populate:
expansionStatus = "failed"expansionSource = "raw_query"usedFallbackQuery = trueexpansionErrorwith short reason
Constraints
- Use this skill for query expansion +
/ecom/cold-outreach/run-floworchestration only. - Do not trigger
/mail/composeor any mail compose flow in this skill. - Do not implement local monitor, local finalize, or local hook event emission.