Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • removed nested response block output, add docs for webhook block, styling improvements for subblocks
  • only internal callers wrapped it in .response, external callers received the root objects directly
  • fixed missing/broken docs links for various blocks
  • added docs for new webhook block
  • fully backwards compatible

Type of Change

  • Bug fix
  • New feature

Testing

Tested manually

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)

@vercel
Copy link

vercel bot commented Jan 7, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 7, 2026 2:46am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 7, 2026

Greptile Summary

This PR removes the nested response wrapper from Response block output, flattening the structure from {response: {data, status, headers}} to {data, status, headers}. The change improves API consistency since external callers always received the flat structure while internal callers had to navigate the nested path.

Key changes:

  • Response handler now returns flat NormalizedBlockOutput structure
  • Block resolver implements backwards compatibility by automatically stripping response. prefix from old variable references like <responseBlock.response.data>
  • Workflow block references also supported: <workflow1.result.response.data><workflow1.result.data>
  • Comprehensive test coverage added (532 new test lines) validating both old and new reference formats
  • Streaming and workflow utils updated to expect flat output structure
  • UI improvements: added tag dropdown support to name input fields in sub-blocks
  • Documentation additions: new webhook block docs, fixed broken docsLink references, corrected image paths for webhook trigger docs

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The refactoring is well-executed with comprehensive backwards compatibility handling and extensive test coverage. The block resolver intelligently detects old reference patterns and strips the response. prefix only when appropriate (checking block type and verifying the new flat structure). All edge cases are covered including mixed scenarios and non-response blocks
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/executor/handlers/response/response-handler.ts Removed nested response wrapper from output - now returns flat {data, status, headers} instead of {response: {data, status, headers}}
apps/sim/executor/variables/resolvers/block.ts Added backwards compatibility logic to strip response. prefix for old references, handles both response block and workflow block scenarios
apps/sim/executor/variables/resolvers/block.test.ts Added comprehensive test coverage for response block backwards compatibility (new and old formats)
apps/sim/lib/workflows/streaming/streaming.ts Removed fallback to output.response path in extractOutputValue, now expects flat structure
apps/sim/lib/workflows/utils.ts Removed output.response check in workflowHasResponseBlock and updated createHttpResponseFromBlock to access flat output structure
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx Added tag dropdown support to name input fields with overlay scrolling and text highlighting

Sequence Diagram

sequenceDiagram
    participant Client as External Client
    participant Workflow as Workflow Executor
    participant Response as Response Block Handler
    participant BlockResolver as Block Resolver
    participant Utils as Workflow Utils
    
    Note over Response: BEFORE: {response: {data, status, headers}}
    Note over Response: AFTER: {data, status, headers}
    
    Client->>Workflow: Execute workflow
    Workflow->>Response: execute()
    Response-->>Workflow: {data, status, headers} (flat structure)
    
    alt Internal caller (another workflow via workflow block)
    Workflow->>BlockResolver: resolve("<workflow1.result.response.data>")
    Note over BlockResolver: Detects old format reference<br/>Applies backwards compat
    BlockResolver->>BlockResolver: Strip "response." prefix
    BlockResolver-->>Workflow: Returns result.data (success!)
    else Internal caller (using new format)
    Workflow->>BlockResolver: resolve("<workflow1.result.data>")
    BlockResolver-->>Workflow: Returns result.data directly
    end
    
    alt External caller (HTTP webhook)
    Workflow->>Utils: createHttpResponseFromBlock()
    Note over Utils: Accesses executionResult.output directly<br/>(no .response wrapper)
    Utils-->>Client: HTTP response with data, status, headers
    end
Loading

@waleedlatif1 waleedlatif1 merged commit 5145ce1 into staging Jan 7, 2026
10 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/response branch January 7, 2026 03:43
waleedlatif1 added a commit that referenced this pull request Jan 8, 2026
… for webhook block, styling improvements for subblocks (#2700)

* improvement(response): removed nested response block output, add docs for webhook block, styling improvements for subblocks

* remove outdated block docs

* updated docs

* remove outdated tests
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.

2 participants