Fetches new Zendesk tickets, classifies them by type and urgency, searches the Notion knowledge base for an answer, and routes what it cannot resolve to Slack. Every call runs on the support agent's own delegated OAuth.
This repo uses a single SCALEKIT_USER_ID env var to simulate one user. In production, pass each user's real ID as the identifier on every Scalekit call, and send them an authorization link whenever their connector status is not ACTIVE. Zendesk, Slack, and Notion tokens all refresh automatically.
class Connector:
def __init__(self, actions, connector_name, identifier):
self.actions = actions
self.connector_name = connector_name
self.identifier = identifier
def check_auth(self) -> bool:
resp = self.actions.get_or_create_connected_account(
connection_name=self.connector_name,
identifier=self.identifier,
)
if resp.connected_account.status != "ACTIVE":
link = self.actions.get_authorization_link(
connection_name=self.connector_name,
identifier=self.identifier,
).link
logger.warning(f"Authorize here: {link}")
return False
return TrueThree things you'd otherwise build: Zendesk OAuth for ticket access, Notion token storage for KB search, Slack identity for routing. All must be live when the ticket lands. Handled.
You have the Scalekit authstack plugin installed (AgentKit + SaaSKit skills and MCP auth). Before coding, auto-load the AgentKit skills relevant to connectors (Zendesk, Slack, Notion) and use the Scalekit MCP server to validate tool calls instead of hand-written API logic.
Poll Zendesk for new and open tickets. Classify each by category and severity with an LLM (fall back to keyword rules if the API is unavailable). Search the Notion knowledge base for matching articles when the category calls for it. Post a formatted triage message to the category's Slack channel, then update the Zendesk ticket with tags, priority, and an internal note. Track processed tickets in a file-backed state store so restarts never re-triage.
Read-only steps (Zendesk fetch, Notion search) run without asking; ask before using write tools (Slack post, Zendesk update). Exit 0 on success, 1 on error, 2 if no new tickets.
Each one runs on delegated identity, scoped per user.