Skip to content

Conversation

@bensabic
Copy link
Contributor

@bensabic bensabic commented Dec 1, 2025

This PR refactors the HTTP Request action from a hardcoded system action into a proper plugin (plugins/native/), making it extensible and consistent with the plugin architecture. Other related changes have also been made.

New Plugin: Native

Created plugins/native/ with:

  • index.ts: Plugin definition with HTTP Request action
  • icon.tsx: Globe icon for the Native category
  • steps/http-request.ts: Step function with execution logic
  • codegen/http-request.ts: Code generation template

New Components

ObjectBuilder
Added components/workflow/config/object-builder.tsx - a reusable component for building key-value pairs (similar to SchemaBuilder). Used for HTTP headers configuration.

IntegrationSelectField
Added integration selector component that displays HTTP-enabled integrations grouped by type. Allows selecting an existing integration to auto-inject authentication headers.

New Config Field Types

Added to plugins/registry.ts and action-config-renderer.tsx:

  • object-builder: Key-value pair builder with validation support
  • integration-select: Dropdown for selecting HTTP-enabled integrations
  • json-editor: Monaco-based JSON editor with real-time validation

Integration-Based HTTP Requests

Plugins can now define httpConfig for HTTP integration support:

  • New PluginHttpConfig type with baseUrl, authHeader, authPrefix, authCredentialKey
  • Added httpConfig to Resend, Slack, Firecrawl, and Linear plugins
  • HTTP Request step auto-injects auth headers from selected integration
  • Endpoint field shows baseUrl prefix when integration is selected

Plugin System Enhancements

  • Added requiresIntegration flag to hide plugins that don't need credentials from setup dialog
  • Added requiresIntegration() helper function to centralize integration checks

Header Validation

  • Added validateKey/validateValue functions to ActionConfigField
  • Plugin-defined validation (validation logic lives in plugin, not renderer)
  • HTTP headers validated to alphanumeric + hyphen/underscore only
  • Content-Type header blocked (auto-set to application/json)

Integration Loading Optimization

  • Cached integrations in Jotai store for faster loading when switching actions
  • Prefetch integrations when workflow loads

Migration & Backward Compatibility

  • Added HTTP Request -> native/http-request legacy mapping
  • Updated codegen files to support both legacy and new action IDs
  • Existing workflows using "HTTP Request" will continue to work

UI Improvements

  • TemplateBadgeInput supports optional prefix prop (for adding the plugin's API base to the endpoint field)
  • Extracted PropertyRow component to reduce ObjectBuilder complexity
  • Horizontal scroll instead of wrap for long input values (useful for long header names or values)

Bug Fixes

  • Fixed required field validation to respect defaultValue - fields with defaults (like HTTP Method) are no longer incorrectly flagged as missing

Cleanup

Removed HTTP Request from system actions:

  • Deleted lib/steps/http-request.ts
  • Deleted lib/codegen-templates/http-request.ts
  • Removed from lib/workflow-executor.workflow.ts, lib/steps/index.ts, and UI components

Plugin Templates & Documentation:
  - Update templates to new declarative structure (configFields, formFields with envVar, getTestFunction)
  - Remove obsolete files: settings.tsx.txt, steps/action/config.tsx.txt (now auto-generated)
  - Restructure: steps/action/step.ts.txt → steps/action.ts.txt
  - Rename: index.tsx.txt → index.ts.txt
  - Fix template placeholders to use valid identifiers (fieldA, resultId) so generated code compiles
  - Update CONTRIBUTING.md with streamlined plugin development guide

Create Plugin Script:
  - Add interactive pnpm create-plugin wizard using @inquirer/prompts
  - Prompts for integration name, description, action name, and action description
  - Auto-replaces integration and action name placeholders in generated files
  - Auto-runs discover-plugins after scaffolding to register the plugin
  - Exit with error if template files are missing
  - Graceful Ctrl+C handling with ExitPromptError
This refactors the HTTP Request action from a hardcoded system action
into a proper plugin under plugins/native/, making it extensible and
consistent with the plugin architecture.

## New Plugin: Native

Created plugins/native/ with:
- index.ts: Plugin definition with HTTP Request action
- icon.tsx: Globe icon for the Native category
- steps/http-request.ts: Step function with execution logic
- codegen/http-request.ts: Code generation template

## New Component: ObjectBuilder

Added components/workflow/config/object-builder.tsx - a reusable
component for building key-value pairs (similar to SchemaBuilder).
Used for HTTP headers and body configuration instead of JSON editors.

## New Config Field Type

Added 'object-builder' type to ActionConfigField in plugins/registry.ts
and the corresponding renderer in action-config-renderer.tsx.

## Migration & Backward Compatibility

- Added 'HTTP Request' -> 'native/http-request' legacy mapping
- Updated codegen files to support both legacy and new action IDs
- Existing workflows using "HTTP Request" will continue to work

## Optional Integration Support

- Add requiresIntegration flag to plugin registry for plugins that don't need credentials
- Add shared requiresIntegration() function to centralize integration checks
- Hide Native plugin from integration setup dialog since it needs no config

## Integration Loading Optimization

- Cache integrations in Jotai store for faster loading when switching actions
- Prefetch integrations when workflow loads

## Cleanup

Removed HTTP Request from system actions in:
- lib/steps/http-request.ts (deleted)
- lib/codegen-templates/http-request.ts (deleted)
- lib/workflow-executor.workflow.ts
- lib/steps/index.ts
- components/workflow/config/action-config.tsx
- components/workflow/nodes/action-node.tsx
- components/workflow/config/action-grid.tsx

## Integration-Based HTTP Requests

Added httpConfig to plugins for leveraging existing integrations:
- New PluginHttpConfig type with baseUrl, authHeader, authPrefix, authCredentialKey
- Added httpConfig to Resend, Slack, Firecrawl, and Linear plugins
- New 'integration-select' field type for selecting HTTP-enabled integrations
- HTTP Request step auto-injects auth headers from selected integration
- Endpoint field shows baseUrl prefix when integration is selected

## JSON Editor for Request Body

- New 'json-editor' field type using Monaco editor
- Supports nested objects, arrays, numbers, booleans
- Real-time JSON validation with error display
- Replaced object-builder for HTTP body configuration

## Header Validation

- Added validateKey/validateValue functions to ActionConfigField
- Plugin-defined validation (validation logic lives in plugin, not renderer)
- HTTP headers validated per Cloudflare rules (alphanumeric + hyphen/underscore)
- Content-Type header blocked (auto-set to application/json)

## UI Improvements

- TemplateBadgeInput supports optional prefix prop
- Extracted PropertyRow component to reduce ObjectBuilder complexity
- Horizontal scroll instead of wrap for long input values
@vercel
Copy link
Contributor

vercel bot commented Dec 1, 2025

@bensabic is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@bensabic bensabic requested a review from ctate December 2, 2025 09:44
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