计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
intercom-core-workflow-b【效率与协作】Manage Intercom conversations: create, reply, close, snooze, assign, and tag. Use when building conversation management features, automating replies, or implementing support workflow automation. Trigger with phrases like "intercom conversations", "intercom reply", "intercom assign conversation", "intercom close conversation", "intercom snooze", "mana…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: intercom-core-workflow-b description: 'Manage Intercom conversations: create, reply, close, snooze, assign, and tag.
Use when building conversation management features, automating replies,
or implementing support workflow automation.
Trigger with phrases like "intercom conversations", "intercom reply",
"intercom assign conversation", "intercom close conversation",
"intercom snooze", "manage intercom conversations".
' allowed-tools: Read, Write, Edit, Bash(npm:*), Grep version: 1.6.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
Manage the full conversation lifecycle: create, reply (as admin or contact), assign to teams, close, snooze, and tag. Conversations contain threaded "parts" including messages, notes, and assignments.
This SKILL.md gives you the high-level workflow and the essential skeleton. The complete step-by-step code for all seven operations lives in references/implementation.md; realistic end-to-end scenarios are in references/examples.md.
intercom-install-auth setup (provides the INTERCOM_ACCESS_TOKEN)client.admins.list())All calls authenticate with a bearer access token supplied to the SDK client — see intercom-install-auth for how to obtain and store it. Read it from the environment, never hard-code it:
import { IntercomClient } from "intercom-client";
const client = new IntercomClient({
token: process.env.INTERCOM_ACCESS_TOKEN!,
});
The raw run_assignment_rules endpoint (Step 3) uses the same token as an Authorization: Bearer header.
The workflow is seven operations against client.conversations.*. Reach for the one you need — they are independent once you have a conversation ID.
conversations.create({ from, body }) opens a conversation from a contact and returns its conversationId.conversations.reply(...) adds a part. type: "admin" is customer-visible, type: "note" is internal-only, type: "user" is a contact reply.conversations.assign(...) routes to an admin (type: "admin") or team (type: "team"); or POST run_assignment_rules for auto-routing.conversations.close(...), conversations.snooze({ snoozedUntil }) (Unix seconds), and conversations.open(...).conversations.attachTag(...) / detachTag(...).conversations.find(...) returns state, assignee, and the conversationParts thread.conversations.list() or conversations.search({ query, pagination, sort }) with AND/OR field filters.Essential skeleton (create then reply); see references/implementation.md for every step in full:
const conversation = await client.conversations.create({
from: { type: "user", id: "6657add46abd0167d9419c3a" }, // Contact ID
body: "Hi, I'm having trouble with my billing. Can you help?",
});
await client.conversations.reply({
conversationId: conversation.conversationId,
body: "Hi there! I'd be happy to help. What's the issue?",
type: "admin",
adminId: "12345",
});
Each operation returns the affected conversation (or acknowledges the mutation):
create → a conversation object exposing conversationId (use it for every follow-up call).reply / assign / close / snooze / open → the updated conversation with its new state and appended part.find → the full conversation: state ("open" | "closed" | "snoozed"), adminAssigneeId, and conversationParts (totalCount + the ordered thread of comment / note / assignment / close / open parts).search / list → a paginated collection of matching conversations, ordered by your sort clause.| State | Description | Transitions |
|---|---|---|
open | Active, awaiting action | close, snooze |
closed | Resolved | open |
snoozed | Deferred until timestamp | open (auto or manual) |
| Part Type | Description | Who Creates |
|---|---|---|
comment | Visible message | Admin or contact |
note | Internal-only note | Admin |
assignment | Reassignment record | System or admin |
close | Conversation closed | Admin |
open | Conversation reopened | Admin or contact |
| Error | HTTP Code | Cause | Solution |
|---|---|---|---|
not_found | 404 | Invalid conversation or admin ID | Verify IDs exist |
conversation_not_found | 404 | Conversation deleted | Handle gracefully |
admin_not_found | 404 | Admin ID invalid | Use client.admins.list() |
parameter_invalid | 422 | Missing body or type | Include required fields |
conversation_closed | 400 | Action on closed conversation | Reopen first |
For common errors and debugging, see intercom-common-errors.
Three end-to-end scenarios are worked in full in references/examples.md:
The billing flow, in brief:
const conversation = await client.conversations.create({
from: { type: "user", id: "6657add46abd0167d9419c3a" },
body: "Hi, I'm having trouble with my billing. Can you help?",
});
await client.conversations.assign({
conversationId: conversation.conversationId,
type: "team",
adminId: "12345",
assigneeId: "team-billing-123",
body: "Routing to billing team",
});
await client.conversations.close({
conversationId: conversation.conversationId,
adminId: "12345",
body: "Issue resolved! Let us know if you need anything else.",
});