workflow-automation.md 3.7 KB

Automated Workflow

This reference defines the default automation layer for the Wuling overseas dealer expansion skill. It is an orchestration layer, not a replacement for the safety rules in outreach-rules.md.

Trigger

Use scripts/workflows/run_dealer_pipeline.py when the user asks to automate the process, run the daily dealer pipeline, refresh the workbook/dashboard, or synchronize the latest customer table after local updates.

Typical command:

python scripts/workflows/run_dealer_pipeline.py --config workflow_config.json --write-workbook

Review-only command:

python scripts/workflows/run_dealer_pipeline.py --config workflow_config.json --review-only

Config

The project root may contain workflow_config.json. If it does not exist, use assets/workflow_config.example.json as the template and tell the user that the project has not been configured yet.

Do not put secrets in the skill package. SMTP codes, browser credentials, cookies, Feishu tokens, and customer workbooks must remain project/runtime data.

Important fields:

  • country: target country for search and reporting.
  • profile_id: AdsPower profile ID for browser stages.
  • excel: optional workbook path. If empty, use the workbook resolver.
  • summary_sheet_name: default 客户信息汇总表.
  • daily_outreach_target: dashboard/business target, currently 20.
  • default_stages: default safe stages, usually summary, dashboard, feishu_check.
  • sync_feishu: when true, the agent must check feishu_sync_config.json after local writeback.
  • send_email and send_facebook_dm: must remain false unless the user explicitly asks for sending and confirms the preview.

Default Pipeline

  1. Resolve workbook.
  2. Rebuild or preview 客户信息汇总表.
  3. Generate the customer dashboard from the summary sheet and Facebook对话记录 when present.
  4. Check Feishu sync configuration.
  5. If Feishu is enabled, the agent must call WorkBuddy lark-sheets after local Excel writeback and verify remote row count/header consistency.
  6. Write a JSON report under runs/YYYYMMDD/<run_id>/.

Human Confirmation Boundaries

The automated pipeline may refresh local summaries and dashboards. It must not silently send messages or emails.

These actions always require a full preview in the chat and explicit confirmation:

  • Send emails.
  • Follow or DM customers on Facebook.
  • Send LinkedIn messages or connection notes.
  • Write Facebook conversation analysis back to Excel after agent translation/analysis.

Browser Rules

Any browser stage must use AdsPower + Playwright. The browser must remain open even when the automation fails. Cross-customer or external-page transitions use major pacing, page-internal steps use minor pacing, and DOM waits remain technical waits as defined in outreach-rules.md.

Feishu Sync

The Python workflow only reports whether Feishu sync is required. The agent is responsible for invoking the WorkBuddy Feishu/Lark sheets plugin because plugin calls are not available inside the local Python process.

If feishu_sync_config.json exists and enabled=true, local writeback is not considered fully complete until the agent attempts Feishu synchronization or reports a plugin/authorization blocker.

Failure Handling

  • If no workbook is found, stop and report the missing workbook. Only create a workbook from the blank skill template when a write-mode run explicitly allows it.
  • If dashboard generation fails, keep the workbook result and report the dashboard failure.
  • If Feishu sync fails, do not roll back the local workbook.
  • If a browser stage hits verification, throttling, security warning, or thread mismatch, stop the batch and keep the AdsPower browser open.