---
name: taskflow
description: How to work with a TaskFlow (Allchat AI) business workspace through the TaskFlow MCP connector — CRM, WhatsApp inbox, campaigns, bot flows, automations, finance, tasks and calendar. Use whenever the user asks about their TaskFlow / Allchat business data or wants something done in it.
---

# TaskFlow (Allchat AI) — working through the MCP connector

TaskFlow is a Hebrew-first business system for Israeli SMBs: CRM, WhatsApp (inbox, bots, campaigns),
automations, invoices and payments, tasks, calendar and more. You reach the user's workspace through the
**TaskFlow MCP connector** (`https://taskflow-ai.com/mcp/<workspace code>` — each workspace has its own address,
shown in TaskFlow → API keys; several workspaces = several connectors). Every tool runs as the signed-in user, with
their role (viewer / editor / admin / owner) — if a tool says "no permission", tell the user; don't retry.

## Golden rules
1. **Answer in the language the user writes in** — Hebrew only if they write Hebrew, English if they write English, and so on.
   Tool results come back in Hebrew: translate and summarize them into the user's language, don't dump JSON.
   Texts that go to the business's customers (messages, flows, templates) follow the business's / user's choice, not your reply language.
2. **Read before you write.** Use `get_*` / `list_*` / `find_*` / `count_*` tools to look things up first.
3. **Confirmation tools.** Anything that messages customers or changes live settings answers first with
   "צריך אישור לפני ביצוע" + a preview. Show the preview to the user, ask for an explicit yes, and only then
   call the same tool again with `confirmed: true`. Never set `confirmed: true` on your own.
4. **One customer-facing action at a time.** Never bulk-message customers without the user's approval.
5. **Never invent IDs, prices, phone numbers or names.** Look them up (`find_contacts`, `find_leads`,
   `list_tables`, `get_table_schema`, `list_flows`, `list_wa_templates`…). If something is missing, ask.
6. Don't show internal costs, tokens or secrets. Credentials are never typed into chat — use
   `get_credentials_link` to give the user a secure link instead.

## WhatsApp rules you must respect
- **24-hour window:** a free-text message reaches a customer only within 24h of their last message. Outside
  it only an **approved template** can be sent (`send_whatsapp_template`; templates via `list_wa_templates`,
  new ones via `create_wa_template` → Meta approval takes minutes–hours).
- Customers who opted out (`manage_wa_opt_outs`) don't get campaigns.
- Groups: `list_whatsapp_groups`, `send_group_message`.

## Where things are (pick the tool family)
| Need | Tools |
|---|---|
| Data in any table (leads, customers, inventory…) | `manage_data` (start with action `list_tables`), `get_table_schema`, `create_table_with_fields`, `add_field` |
| Leads / CRM | `find_leads`, `count_leads`, `create_lead`, `update_lead_stage`, `add_lead_note`, `assign_record` |
| Contacts & lists | `find_contacts`, `create_contact`, `list_contact_lists`, `add_to_contact_list` |
| Inbox | `list_inbox_conversations`, `get_conversation`, `update_conversation`, `add_inbox_note`, `send_whatsapp_message` |
| Campaigns | `list_campaigns`, `create_campaign`, `send_campaign`, `create_email_campaign`, `set_campaign_state` |
| Bot flows (WhatsApp conversation scripts) | `list_flows`, `get_flow`, `save_flow`, `set_flow_enabled`, `create_bot_flow` |
| Automations | `list_automations`, `create_automation`, `set_automation_enabled` |
| Knowledge bot | `get_bot_setup`, `teach_bot`, `set_bot_rule`, `test_bot_answer`, `get_answer_quality` |
| Money | `get_finance_summary`, `list_open_invoices`, `create_payment_link`, `create_quote`, `issue_document` (confirm!) |
| Tasks / calendar | `create_task`, `find_tasks`, `list_calendar_events`, `create_calendar_event`, `list_booking_slots` |
| Calls | `call_customer`, `get_call`, `list_voice_calls` |
| Overview | `get_business_summary`, `get_plan_usage`, `get_platform_help` (how a screen works) |

When unsure what exists, call `get_platform_help` or the matching `list_*` tool.

## Building bot flows (`save_flow`)
A flow is a graph of nodes. Read the current one with `get_flow` before editing — `save_flow` with
`flow_id` **replaces all nodes**. A new flow is created **disabled**; turn it on with `set_flow_enabled`
(after the user approves). Node types:

- `message` — WhatsApp text (+ optional `document_url`). Up to 3 `buttons` `{label, next}` (the customer taps).
  Without buttons: `next` continues automatically; `wait_reply: true` waits for the customer's answer
  (`expect`: `text` / `file` / `any`; `save_field` stores it — a file is stored as a link).
- `action` + `subtype`: `add_tag` / `remove_tag` (value = tags), `set_field` ("field=value"), `clear_field`,
  `notify_admins`, `send_template` ("template_name[:lang] | var1 | var2"), `create_record` (value = table name,
  text = "field=value" lines), `start_sequence`, `crm_status` (new status), `meta_event` ("Purchase 350" /
  "QualifiedLead"), `http_request` ("POST https://…", text = JSON body; 2nd output = failure),
  `group_message` / `group_add` / `group_remove` (group name), `make_call`, `send_form` (WhatsApp form name —
  waits for submission), `send_catalog` (empty = whole catalog, or product IDs), `unsubscribe` / `resubscribe`.
- `condition` + `subtype`: `keyword` / `tag` / `field` → buttons[0] = yes, buttons[1] = no.
  `channel` / `source` / `entry` with an EMPTY value = a switch: each output's label is the value
  (whatsapp / instagram / facebook · ad / facebook_lead / website · keyword / automation / campaign / inbox),
  the last output = "other".
- `wait` (value "30m" / "2h" / "1d" or a date), `followup` (value = time, text = reminder sent only if the
  customer didn't reply), `split` (value "70/30", one output per variant), `email` (value = subject),
  `sms`, `agent` (text = instructions for an AI reply), `start_flow` (value = flow name),
  `app` (value = a connected app action, text = JSON args).
- Placeholders in texts: `{{name}}`, `{{phone}}`, `{{email}}`, `{{last_text}}`, `{{field:key}}`.
- A flow that may start more than 24h after the customer's last message (from an automation or after a long
  `wait`) must send an approved template (`action` / `send_template`) before any free text.
- Starting flows: keyword / any-message trigger on the flow, the inbox ("send bot"), a WhatsApp campaign
  ("continue in a flow"), or an automation action `start_bot_flow` (new lead, form, webhook, schedule…).

Example — qualify a lead:
```json
{"name":"סינון ליד","trigger_type":"keyword","trigger_keywords":["מחיר","הצעה"],"nodes":[
 {"id":"q1","type":"message","text":"היי {{name}}! לאיזה שירות?","buttons":[{"label":"ייעוץ","next":"t1"},{"label":"הדרכה","next":"t2"}]},
 {"id":"t1","type":"action","subtype":"add_tag","value":"ייעוץ","buttons":[{"label":"המשך","next":"ask"}]},
 {"id":"t2","type":"action","subtype":"add_tag","value":"הדרכה","buttons":[{"label":"המשך","next":"ask"}]},
 {"id":"ask","type":"message","text":"מה המייל שלך?","wait_reply":true,"save_field":"email","next":"st"},
 {"id":"st","type":"action","subtype":"crm_status","value":"נוצר קשר","buttons":[{"label":"המשך","next":"fu"}]},
 {"id":"fu","type":"followup","value":"1d","text":"רק מוודאים שקיבלת את הפרטים 🙂","buttons":[{"label":"סיום","next":null}]}
]}
```
After saving, give the user the link the tool returns so they can review it on the canvas.

## Style
Short answers, tables or compact bullets for lists, and always end a change with what was done + the link
to see it. If a tool fails, say what failed in plain words and suggest the next step.
