Slack Actions Query
Available Context & Tools
@_platform-references/org-variables.md @_platform-references/capabilities.md
Slack Actions Query
Goal
Enable quick sales actions from Slack without leaving the conversation. The pattern is always preview-then-confirm — show the draft or task details, let the user approve or edit, then execute. Never execute irreversible actions (sending emails, creating records) without explicit user confirmation.
Action Types
Draft Email (draft_email)
Generate a follow-up email draft using AI, then present it for approval.
Context gathering:
- Find the most relevant deal (by
deal_nameor first active deal) - Find the most relevant contact (by
contact_nameor contact linked to the deal) - Fetch last meeting summary for context
If no deal and no contact found: Return "I need more context to draft an email. Try: 'Draft a follow-up for [deal name]' or 'Draft an email to [contact name]'."
AI email generation (Claude Haiku):
- System prompt: "You are a sales email assistant. Write concise, professional follow-up emails. Today's date: {today}. Keep emails under 150 words. Be warm but direct. Include a clear next step or CTA."
- Context injected: deal name + stage, contact name + title + company, last meeting summary (first 500 chars)
- User prompt: the raw query + context parts
Response format:
- Section:
*Draft Follow-up for {Recipient Name}:* - Divider
- Section: the AI-generated email draft
- Divider
- Actions:
- "Approve & Send" (primary, green) —
actionId: copilot_send_email, value:{ draft, dealId, contactId } - "Edit" —
actionId: copilot_edit_draft, value:{ draft, dealId } - "Dismiss" —
actionId: copilot_dismiss, value:dismiss
- "Approve & Send" (primary, green) —
- Context: "I'll hold this draft until you approve. Reply with edits if you want changes."
Store pendingAction:
{
"type": "send_email",
"data": { "draft": "...", "dealId": "...", "contactId": "...", "recipientEmail": "..." }
}
Fallback (AI unavailable):
- Section: "I'd draft a follow-up for {Recipient Name}, but I need the AI service to generate it."
- Section (if last meeting summary available): "Based on your last meeting: {summary truncated to 200 chars}"
- Context: "Try again in a moment, or draft it manually in the app."
Create Task (create_task)
Extract the task description from the message and present a confirmation.
Task title extraction:
- Match pattern:
/(?:create|add|make)\s+(?:a\s+)?task\s+(?:to\s+)?(.+)/i - If no match: use the full raw query as the task title
- Strip trailing period from extracted title
Response format:
- Section:
*Create Task:*\n{taskTitle}\nDeal: {deal.title}(omit deal line if no deal) - Actions:
- "Create Task" (primary, green) —
actionId: copilot_create_task, value:{ title, dealId } - "Edit First" —
actionId: copilot_edit_task, value:{ title, dealId } - "Cancel" —
actionId: copilot_dismiss, value:dismiss
- "Create Task" (primary, green) —
Store pendingAction:
{
"type": "create_task",
"data": { "title": "...", "dealId": "..." }
}
Schedule Meeting (schedule_meeting)
Meeting creation requires the full app — redirect the user gracefully.
Response format:
- Section: If contact found: "Schedule a meeting with {Contact Name} in the app. Use /sixty calendar to check availability." If no contact: "Meeting creation is in the app. Use /sixty calendar to check availability."
- Context: "Use
/sixty calendarto see your schedule, or ask me 'show my meetings this week'."
Send Email Confirmation (send_email)
User said "send" without first drafting — guide them to the correct flow.
Response format:
- Plain text: "To send an email, first draft one with 'Draft a follow-up for [deal]' and then approve it."
Data Sources
- Deals:
execute_action("list_deals", { status: "active", owner: slack_user_id }) - Contacts:
execute_action("search_contacts", { query: contact_name }) - Last meeting:
execute_action("list_meetings", { owner: slack_user_id, limit: 1 })
Preview-Confirm Flow
All actions that create or send data use the preview-confirm pattern:
- User requests action → show preview with Approve/Edit/Dismiss buttons
- User clicks "Approve" → system executes the action
- User clicks "Edit" → system opens editor (in-app or inline)
- User clicks "Dismiss" → clear pending action, no action taken
The pendingAction object is stored server-side keyed to the Slack thread so follow-up "confirm" messages can execute it.
Response Constraints
- Never execute sends or creates without explicit button click confirmation
- Email drafts: 150 words maximum — brevity beats comprehensiveness for follow-ups
- Task titles: preserve the user's language — don't rewrite or clean up their phrasing significantly
- Always include "Dismiss" / "Cancel" option — give users an escape hatch
- Today's date MUST be injected into email generation prompts for temporal accuracy
Error Cases
- No context for email draft: Return guidance message with example phrasings
- AI unavailable: Show structured fallback with last meeting context (never fail silently)
- Action type unrecognised: Return "Choose: draft email, create task, or schedule meeting."