Slack Next-Gen Platform Custom Function SDK Prompt
Design and implement a reusable custom function on Slack's next-gen (Deno) platform so it can be wired as a step in Workflow Builder by non-engineers, with typed inputs/outputs and a datastore-backed action
- Target user
- Platform engineers building modular Workflow Builder steps with the Slack CLI/Deno SDK
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Slack apps on the next-generation (Deno/TypeScript) platform with the Slack CLI and the deno-slack-sdk.
I will provide:
- The operation the function should perform (e.g. open a change ticket, look up a service owner, post a templated notice)
- The inputs Workflow Builder users will supply and the outputs downstream steps need
- Any external API or datastore the function must call, plus the scopes available
Your job:
1. **Function definition** — write the `DefineFunction` block with a typed `input_parameters` and `output_parameters` schema using `Schema.*` types so it surfaces cleanly in Workflow Builder.
2. **Handler implementation** — implement the `SlackFunction` handler, using the injected `client` for Web API calls and returning `{ outputs }` or `{ error }` per the SDK contract.
3. **Datastore integration** — if state is needed, define a datastore and show `apps.datastore.put/get/query` via the typed client.
4. **Manifest wiring** — show how the function registers in `manifest.ts` and which `botScopes` it requires.
5. **Error and completion semantics** — handle the async-completion case (`completeFunction`) for long-running external calls so the workflow does not hang.
6. **Local test + deploy** — give the `slack run` (local) and `slack deploy` commands and a minimal unit test of the handler.
7. **Composability guidance** — note how to keep inputs/outputs generic enough for reuse across multiple workflows.
Output as: the full function file (definition + handler), the manifest snippet, and the CLI commands, with inline comments on the typed schema.
Caution: next-gen apps run on Slack-hosted Deno infrastructure with their own scopes and connectors — do not assume classic bot-token Web API parity; verify each method is available to hosted functions before shipping.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Slack Next-Gen Scheduled Trigger Provisioning Prompt
Provision and manage scheduled triggers for next-gen platform workflows via the Slack CLI and workflows.triggers.create so a recurring ops workflow (digest, sweep, reminder) fires on a precise cadence without a self-managed cron host
-
Slack Datastore App State Persistence Prompt
Model and operate Slack-hosted datastores for next-gen platform app state without standing up external databases
-
Slack Link Triggers as Workflow Entrypoints Prompt
Design shareable link triggers that launch next-gen Slack platform workflows from buttons, bookmarks, and messages
-
Slack App Rate-Limit Tier & Capacity Planning Prompt
Model a Slack app's request budget across method tiers, size fan-out and polling under per-workspace limits, and design a token-bucket schedule that never trips 429s.
More Slack prompts & error guides
Browse every Slack prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.