Skip to content

improvement(slack-trigger): expose view, message, and state on interactivity payloads#5279

Merged
waleedlatif1 merged 1 commit into
stagingfrom
worktree-slack-trigger-interactivity-payload
Jun 30, 2026
Merged

improvement(slack-trigger): expose view, message, and state on interactivity payloads#5279
waleedlatif1 merged 1 commit into
stagingfrom
worktree-slack-trigger-interactivity-payload

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

The native Slack trigger flattened every interaction into scalar event.* fields and dropped the structured objects — so workflows on the trigger could not read view.state.values / view.private_metadata (modal submissions) or message.blocks (block-rewrite paths). This passes the full structured objects through and declares them in the trigger outputs.

  • event.view — full Slack view object for modal interactions (view_submission/view_closed): state.values, private_metadata, id, callback_id, hash, blocks, title.
  • event.message — full source message object for block_actions on a message (incl. blocks), so block-rewrite paths can edit it.
  • event.state — top-level block_actions state.values (current input values of the surface read on a button click, without a modal submit).

All three are declared in the trigger outputs (type json) so they surface in the editor output picker. null when Slack does not send them (verified against the docs: no top-level message/trigger_id on view_submission, no view on a message-based block action).

Context

Unblocks moving the Slack interactivity workflows off the generic webhook trigger and onto the native Slack trigger (the durable fix for the trigger_id 3s race). Without these fields the swap would have been a payload-contract rebuild; with them it is a clean rename.

Type of Change

  • Improvement (additive trigger outputs)

Testing

  • Verified the full block_actions, view_submission, and view_closed payload shapes against Slack's official interaction-payload docs (docs.slack.dev).
  • formatInput ↔ trigger outputs keys cross-checked: all 29 keys align in both directions.
  • 0 tsc errors, biome clean, 162 webhook tests pass (8 slack-specific, incl. new view/message/state cases), check:api-validation passed.
  • Backwards compatible: purely additive; existing flattened fields unchanged; new fields default to null; processTriggerFileOutputs passes the json fields through untouched.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…ctivity payloads

The native Slack trigger flattened every interaction into scalar event.* fields
and dropped the structured objects, so view_submission and block-rewrite
workflows could not read view.state.values, view.private_metadata, or
message.blocks. Pass the full Slack view and message objects through, plus the
top-level block_actions state (state.values), and declare them in the trigger
outputs so they surface in the editor. Additive and backwards compatible:
existing flattened fields are unchanged and new fields default to null.
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 30, 2026 5:10am

Request Review

@cursor

cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Additive trigger outputs with null defaults; existing scalar fields and Events API paths are unchanged, with coverage in webhook tests.

Overview
The native Slack trigger now forwards full structured interactivity objects instead of only flattened scalars, so workflows can use modal submissions and block-rewrite flows on the native trigger.

formatSlackInteractive copies the raw Slack view, source message, and top-level state onto event (default null when absent). view covers view_submission / view_closed (state.values, private_metadata, etc.); message carries blocks and related fields for block_actions; state exposes surface state.values on button clicks without a modal submit.

The Slack trigger outputs schema adds matching json fields for the editor picker. Existing flattened fields are unchanged; tests cover block_actions and view_submission passthrough.

Reviewed by Cursor Bugbot for commit fe44223. Configure here.

@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR exposes more of Slack's interactivity payload to workflows. The main changes are:

  • Adds event.view, event.message, and event.state to the Slack trigger event.
  • Declares the new fields as json outputs in the Slack webhook trigger.
  • Extends Slack provider tests for block action state/message data and modal view data.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/providers/slack.ts Adds nullable structured Slack interactivity fields and populates them from the raw payload when present.
apps/sim/triggers/slack/webhook.ts Adds matching json output declarations for the new Slack interactivity fields.
apps/sim/lib/webhooks/providers/slack.test.ts Adds tests for message/state passthrough on block actions and view passthrough on modal submissions.

Reviews (1): Last reviewed commit: "improvement(slack-trigger): expose view,..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 98d84f2 into staging Jun 30, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-slack-trigger-interactivity-payload branch June 30, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant