From d77aa0b4c28d67c69217001fed9faf0d3bfd609f Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 27 Jan 2026 16:55:54 -0800 Subject: [PATCH 1/6] improvement(block-inputs): must parse json accurately --- apps/sim/blocks/blocks/apify.ts | 2 +- apps/sim/blocks/blocks/apollo.ts | 20 ++++++++ apps/sim/blocks/blocks/cursor.ts | 2 +- apps/sim/blocks/blocks/elasticsearch.ts | 12 ++--- apps/sim/blocks/blocks/fireflies.ts | 2 +- apps/sim/blocks/blocks/github.ts | 8 +-- apps/sim/blocks/blocks/google_sheets.ts | 10 ++-- apps/sim/blocks/blocks/google_slides.ts | 4 +- apps/sim/blocks/blocks/grafana.ts | 4 +- apps/sim/blocks/blocks/incidentio.ts | 1 + apps/sim/blocks/blocks/intercom.ts | 3 ++ apps/sim/blocks/blocks/knowledge.ts | 6 +-- apps/sim/blocks/blocks/mailchimp.ts | 9 ++++ apps/sim/blocks/blocks/mailgun.ts | 2 +- apps/sim/blocks/blocks/microsoft_excel.ts | 4 +- apps/sim/blocks/blocks/microsoft_planner.ts | 4 +- apps/sim/blocks/blocks/mongodb.ts | 10 ++-- apps/sim/blocks/blocks/notion.ts | 6 ++- apps/sim/blocks/blocks/posthog.ts | 20 +++++--- apps/sim/blocks/blocks/salesforce.ts | 1 + apps/sim/blocks/blocks/sentry.ts | 2 +- apps/sim/blocks/blocks/sharepoint.ts | 4 +- apps/sim/blocks/blocks/tinybird.ts | 2 +- apps/sim/blocks/blocks/zendesk.ts | 4 ++ apps/sim/executor/execution/block-executor.ts | 51 +++++++++++++++++-- 25 files changed, 140 insertions(+), 53 deletions(-) diff --git a/apps/sim/blocks/blocks/apify.ts b/apps/sim/blocks/blocks/apify.ts index 14bc2fc9a9..e7bb264231 100644 --- a/apps/sim/blocks/blocks/apify.ts +++ b/apps/sim/blocks/blocks/apify.ts @@ -151,7 +151,7 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'Apify API token' }, actorId: { type: 'string', description: 'Actor ID or username/actor-name' }, - input: { type: 'string', description: 'Actor input as JSON string' }, + input: { type: 'json', description: 'Actor input as JSON string' }, timeout: { type: 'number', description: 'Timeout in seconds' }, build: { type: 'string', description: 'Actor build version' }, waitForFinish: { type: 'number', description: 'Initial wait time in seconds' }, diff --git a/apps/sim/blocks/blocks/apollo.ts b/apps/sim/blocks/blocks/apollo.ts index 240bc29dec..8dfa2f7f31 100644 --- a/apps/sim/blocks/blocks/apollo.ts +++ b/apps/sim/blocks/blocks/apollo.ts @@ -776,6 +776,26 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes }, inputs: { operation: { type: 'string', description: 'Apollo operation to perform' }, + person_titles: { type: 'json', description: 'Array of job titles' }, + person_locations: { type: 'json', description: 'Array of locations' }, + organization_names: { type: 'json', description: 'Array of organization names' }, + person_seniorities: { type: 'json', description: 'Array of seniority levels' }, + contact_stage_ids: { type: 'json', description: 'Array of contact stage IDs' }, + organization_locations: { type: 'json', description: 'Array of organization locations' }, + organization_num_employees_ranges: { + type: 'json', + description: 'Array of employee count ranges', + }, + q_organization_keyword_tags: { type: 'json', description: 'Array of keyword tags' }, + account_stage_ids: { type: 'json', description: 'Array of account stage IDs' }, + people: { type: 'json', description: 'People data for bulk enrichment' }, + organizations: { type: 'json', description: 'Organizations data for bulk enrichment' }, + contacts: { type: 'json', description: 'Contacts data for bulk operations' }, + accounts: { type: 'json', description: 'Accounts data for bulk operations' }, + contact_ids: { type: 'json', description: 'Array of contact IDs' }, + account_ids: { type: 'json', description: 'Array of account IDs' }, + stage_ids: { type: 'json', description: 'Array of stage IDs' }, + owner_ids: { type: 'json', description: 'Array of owner IDs' }, }, outputs: { success: { type: 'boolean', description: 'Whether the operation was successful' }, diff --git a/apps/sim/blocks/blocks/cursor.ts b/apps/sim/blocks/blocks/cursor.ts index 3c96fc78e6..b9e068e039 100644 --- a/apps/sim/blocks/blocks/cursor.ts +++ b/apps/sim/blocks/blocks/cursor.ts @@ -155,7 +155,7 @@ export const CursorBlock: BlockConfig = { ref: { type: 'string', description: 'Branch, tag, or commit reference' }, promptText: { type: 'string', description: 'Instruction text for the agent' }, followupPromptText: { type: 'string', description: 'Follow-up instruction text for the agent' }, - promptImages: { type: 'string', description: 'JSON array of image objects' }, + promptImages: { type: 'json', description: 'JSON array of image objects' }, model: { type: 'string', description: 'Model to use (empty for auto-selection)' }, branchName: { type: 'string', description: 'Custom branch name' }, autoCreatePr: { type: 'boolean', description: 'Auto-create PR when done' }, diff --git a/apps/sim/blocks/blocks/elasticsearch.ts b/apps/sim/blocks/blocks/elasticsearch.ts index 25796eb742..6988ab2532 100644 --- a/apps/sim/blocks/blocks/elasticsearch.ts +++ b/apps/sim/blocks/blocks/elasticsearch.ts @@ -489,16 +489,16 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, password: { type: 'string', description: 'Password for basic auth' }, index: { type: 'string', description: 'Index name' }, documentId: { type: 'string', description: 'Document ID' }, - document: { type: 'string', description: 'Document body as JSON' }, - query: { type: 'string', description: 'Search query as JSON' }, + document: { type: 'json', description: 'Document body as JSON' }, + query: { type: 'json', description: 'Search query as JSON' }, size: { type: 'number', description: 'Number of results' }, from: { type: 'number', description: 'Starting offset' }, - sort: { type: 'string', description: 'Sort specification as JSON' }, + sort: { type: 'json', description: 'Sort specification as JSON' }, sourceIncludes: { type: 'string', description: 'Fields to include' }, sourceExcludes: { type: 'string', description: 'Fields to exclude' }, - operations: { type: 'string', description: 'Bulk operations as NDJSON' }, - settings: { type: 'string', description: 'Index settings as JSON' }, - mappings: { type: 'string', description: 'Index mappings as JSON' }, + operations: { type: 'json', description: 'Bulk operations as NDJSON' }, + settings: { type: 'json', description: 'Index settings as JSON' }, + mappings: { type: 'json', description: 'Index mappings as JSON' }, refresh: { type: 'string', description: 'Refresh policy' }, waitForStatus: { type: 'string', description: 'Wait for cluster status' }, timeout: { type: 'string', description: 'Timeout for wait operations' }, diff --git a/apps/sim/blocks/blocks/fireflies.ts b/apps/sim/blocks/blocks/fireflies.ts index b092471902..13ea546cd3 100644 --- a/apps/sim/blocks/blocks/fireflies.ts +++ b/apps/sim/blocks/blocks/fireflies.ts @@ -550,7 +550,7 @@ Return ONLY the summary text - no quotes, no labels.`, audioUrl: { type: 'string', description: 'Public URL to audio file' }, title: { type: 'string', description: 'Meeting title' }, language: { type: 'string', description: 'Language code for transcription' }, - attendees: { type: 'string', description: 'JSON array of attendees' }, + attendees: { type: 'json', description: 'JSON array of attendees' }, clientReferenceId: { type: 'string', description: 'Custom reference ID for tracking' }, meetingLink: { type: 'string', description: 'Meeting URL (Zoom, Meet, Teams)' }, meetingPassword: { type: 'string', description: 'Meeting password if required' }, diff --git a/apps/sim/blocks/blocks/github.ts b/apps/sim/blocks/blocks/github.ts index 4a2ae20a9d..2ea06f9770 100644 --- a/apps/sim/blocks/blocks/github.ts +++ b/apps/sim/blocks/blocks/github.ts @@ -1853,9 +1853,9 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, ref: { type: 'string', description: 'Branch, tag, or commit reference' }, // Branch parameters protected: { type: 'string', description: 'Protection status filter' }, - required_status_checks: { type: 'string', description: 'Required status checks JSON' }, + required_status_checks: { type: 'json', description: 'Required status checks JSON' }, enforce_admins: { type: 'boolean', description: 'Enforce for admins' }, - required_pull_request_reviews: { type: 'string', description: 'Required PR reviews JSON' }, + required_pull_request_reviews: { type: 'json', description: 'Required PR reviews JSON' }, // Issue parameters labels: { type: 'string', description: 'Comma-separated labels' }, assignees: { type: 'string', description: 'Comma-separated assignees' }, @@ -1868,7 +1868,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, workflow_id: { type: 'string', description: 'Workflow ID or filename' }, run_id: { type: 'number', description: 'Workflow run ID' }, status: { type: 'string', description: 'Status filter' }, - inputs: { type: 'string', description: 'Workflow inputs JSON' }, + inputs: { type: 'json', description: 'Workflow inputs JSON' }, // Project parameters owner_login: { type: 'string', description: 'Owner login' }, owner_type: { type: 'string', description: 'Owner type (user or org)' }, @@ -1888,7 +1888,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, // Gist parameters gist_id: { type: 'string', description: 'Gist ID' }, description: { type: 'string', description: 'Description' }, - files: { type: 'string', description: 'Files JSON object' }, + files: { type: 'json', description: 'Files JSON object' }, gist_public: { type: 'boolean', description: 'Public gist status' }, username: { type: 'string', description: 'GitHub username' }, // Fork parameters diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index 2598425848..29737a7b4c 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -269,8 +269,8 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, credential: { type: 'string', description: 'Google Sheets access token' }, spreadsheetId: { type: 'string', description: 'Spreadsheet identifier' }, manualSpreadsheetId: { type: 'string', description: 'Manual spreadsheet identifier' }, - range: { type: 'string', description: 'Cell range' }, - values: { type: 'string', description: 'Cell values data' }, + range: { type: 'json', description: 'Cell range' }, + values: { type: 'json', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, insertDataOption: { type: 'string', description: 'Data insertion option' }, }, @@ -826,13 +826,13 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, sheetName: { type: 'string', description: 'Name of the sheet/tab' }, manualSheetName: { type: 'string', description: 'Manual sheet name entry' }, cellRange: { type: 'string', description: 'Cell range (e.g., A1:D10)' }, - values: { type: 'string', description: 'Cell values data' }, + values: { type: 'json', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, insertDataOption: { type: 'string', description: 'Data insertion option' }, title: { type: 'string', description: 'Title for new spreadsheet' }, sheetTitles: { type: 'string', description: 'Comma-separated sheet names for new spreadsheet' }, - ranges: { type: 'string', description: 'JSON array of ranges for batch operations' }, - batchData: { type: 'string', description: 'JSON array of data for batch update' }, + ranges: { type: 'json', description: 'JSON array of ranges for batch operations' }, + batchData: { type: 'json', description: 'JSON array of data for batch update' }, sheetId: { type: 'string', description: 'Numeric sheet ID for copy operation' }, destinationSpreadsheetId: { type: 'string', diff --git a/apps/sim/blocks/blocks/google_slides.ts b/apps/sim/blocks/blocks/google_slides.ts index 016d04a74d..0697a3e4ff 100644 --- a/apps/sim/blocks/blocks/google_slides.ts +++ b/apps/sim/blocks/blocks/google_slides.ts @@ -806,7 +806,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers, // Add slide operation layout: { type: 'string', description: 'Slide layout' }, insertionIndex: { type: 'number', description: 'Position to insert slide' }, - placeholderIdMappings: { type: 'string', description: 'JSON array of placeholder ID mappings' }, + placeholderIdMappings: { type: 'json', description: 'JSON array of placeholder ID mappings' }, // Add image operation pageObjectId: { type: 'string', description: 'Slide object ID for image' }, imageUrl: { type: 'string', description: 'Image URL' }, @@ -824,7 +824,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers, deleteObjectId: { type: 'string', description: 'Object ID to delete' }, // Duplicate object operation duplicateObjectId: { type: 'string', description: 'Object ID to duplicate' }, - duplicateObjectIds: { type: 'string', description: 'JSON object ID mappings' }, + duplicateObjectIds: { type: 'json', description: 'JSON object ID mappings' }, // Reorder slides operation reorderSlideIds: { type: 'string', description: 'Comma-separated slide IDs to move' }, reorderInsertionIndex: { type: 'number', description: 'New position for slides' }, diff --git a/apps/sim/blocks/blocks/grafana.ts b/apps/sim/blocks/blocks/grafana.ts index b748f5b0ec..81974b1a82 100644 --- a/apps/sim/blocks/blocks/grafana.ts +++ b/apps/sim/blocks/blocks/grafana.ts @@ -657,7 +657,7 @@ Return ONLY the folder title - no explanations, no quotes, no extra text.`, title: { type: 'string', description: 'Dashboard or folder title' }, folderUid: { type: 'string', description: 'Folder UID' }, tags: { type: 'string', description: 'Comma-separated tags' }, - panels: { type: 'string', description: 'JSON array of panels' }, + panels: { type: 'json', description: 'JSON array of panels' }, message: { type: 'string', description: 'Commit message' }, query: { type: 'string', description: 'Search query' }, tag: { type: 'string', description: 'Filter by tag' }, @@ -666,7 +666,7 @@ Return ONLY the folder title - no explanations, no quotes, no extra text.`, alertTitle: { type: 'string', description: 'Alert rule title' }, ruleGroup: { type: 'string', description: 'Rule group name' }, condition: { type: 'string', description: 'Alert condition refId' }, - data: { type: 'string', description: 'Query data JSON' }, + data: { type: 'json', description: 'Query data JSON' }, forDuration: { type: 'string', description: 'Duration before firing' }, noDataState: { type: 'string', description: 'State on no data' }, execErrState: { type: 'string', description: 'State on error' }, diff --git a/apps/sim/blocks/blocks/incidentio.ts b/apps/sim/blocks/blocks/incidentio.ts index 31f743258a..cff069511e 100644 --- a/apps/sim/blocks/blocks/incidentio.ts +++ b/apps/sim/blocks/blocks/incidentio.ts @@ -957,6 +957,7 @@ Return ONLY the JSON array - no explanations or markdown formatting.`, state: { type: 'string', description: 'Workflow state' }, // Schedule fields timezone: { type: 'string', description: 'Schedule timezone' }, + config: { type: 'json', description: 'Schedule configuration' }, // Custom field fields description: { type: 'string', description: 'Custom field description' }, field_type: { type: 'string', description: 'Custom field type' }, diff --git a/apps/sim/blocks/blocks/intercom.ts b/apps/sim/blocks/blocks/intercom.ts index 6919679b64..4c6bb16976 100644 --- a/apps/sim/blocks/blocks/intercom.ts +++ b/apps/sim/blocks/blocks/intercom.ts @@ -1393,6 +1393,9 @@ Return ONLY the numeric timestamp.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, accessToken: { type: 'string', description: 'Intercom API access token' }, + custom_attributes: { type: 'json', description: 'Custom attributes for contact' }, + ticket_attributes: { type: 'json', description: 'Ticket attributes' }, + contacts: { type: 'json', description: 'Contacts array' }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, diff --git a/apps/sim/blocks/blocks/knowledge.ts b/apps/sim/blocks/blocks/knowledge.ts index 722c4d7d8d..115d74195c 100644 --- a/apps/sim/blocks/blocks/knowledge.ts +++ b/apps/sim/blocks/blocks/knowledge.ts @@ -144,10 +144,8 @@ export const KnowledgeBlock: BlockConfig = { documentId: { type: 'string', description: 'Document identifier' }, content: { type: 'string', description: 'Content data' }, name: { type: 'string', description: 'Document name' }, - // Dynamic tag filters for search - tagFilters: { type: 'string', description: 'Tag filter criteria' }, - // Document tags for create document (JSON string of tag objects) - documentTags: { type: 'string', description: 'Document tags' }, + tagFilters: { type: 'json', description: 'Tag filter criteria' }, + documentTags: { type: 'json', description: 'Document tags' }, }, outputs: { results: { type: 'json', description: 'Search results' }, diff --git a/apps/sim/blocks/blocks/mailchimp.ts b/apps/sim/blocks/blocks/mailchimp.ts index 147e61e575..d49890759c 100644 --- a/apps/sim/blocks/blocks/mailchimp.ts +++ b/apps/sim/blocks/blocks/mailchimp.ts @@ -1452,6 +1452,15 @@ Return ONLY the JSON array - no explanations or markdown.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'Mailchimp API key with server prefix' }, + contact: { type: 'json', description: 'Contact information JSON object' }, + campaignDefaults: { type: 'json', description: 'Campaign defaults JSON object' }, + campaignSettings: { type: 'json', description: 'Campaign settings JSON object' }, + recipients: { type: 'json', description: 'Recipients JSON object' }, + mergeFields: { type: 'json', description: 'Merge fields JSON object' }, + interests: { type: 'json', description: 'Interests JSON object' }, + tags: { type: 'json', description: 'Tags JSON array' }, + segmentOptions: { type: 'json', description: 'Segment options JSON object' }, + operations: { type: 'json', description: 'Batch operations JSON array' }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, diff --git a/apps/sim/blocks/blocks/mailgun.ts b/apps/sim/blocks/blocks/mailgun.ts index 4fdee43095..2d76b6ec90 100644 --- a/apps/sim/blocks/blocks/mailgun.ts +++ b/apps/sim/blocks/blocks/mailgun.ts @@ -395,7 +395,7 @@ Return ONLY the JSON object - no explanations or markdown.`, accessLevel: { type: 'string', description: 'List access level' }, memberAddress: { type: 'string', description: 'Member email address' }, memberName: { type: 'string', description: 'Member name' }, - vars: { type: 'string', description: 'Custom variables JSON' }, + vars: { type: 'json', description: 'Custom variables JSON' }, subscribed: { type: 'string', description: 'Member subscription status' }, }, diff --git a/apps/sim/blocks/blocks/microsoft_excel.ts b/apps/sim/blocks/blocks/microsoft_excel.ts index adb4c5fa17..b63a6c0b63 100644 --- a/apps/sim/blocks/blocks/microsoft_excel.ts +++ b/apps/sim/blocks/blocks/microsoft_excel.ts @@ -304,7 +304,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, range: { type: 'string', description: 'Cell range' }, tableName: { type: 'string', description: 'Table name' }, worksheetName: { type: 'string', description: 'Worksheet name' }, - values: { type: 'string', description: 'Cell values data' }, + values: { type: 'json', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, }, outputs: { @@ -543,7 +543,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, sheetName: { type: 'string', description: 'Name of the sheet/tab' }, manualSheetName: { type: 'string', description: 'Manual sheet name entry' }, cellRange: { type: 'string', description: 'Cell range (e.g., A1:D10)' }, - values: { type: 'string', description: 'Cell values data' }, + values: { type: 'json', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, }, outputs: { diff --git a/apps/sim/blocks/blocks/microsoft_planner.ts b/apps/sim/blocks/blocks/microsoft_planner.ts index 035832def2..f9c4f859eb 100644 --- a/apps/sim/blocks/blocks/microsoft_planner.ts +++ b/apps/sim/blocks/blocks/microsoft_planner.ts @@ -628,8 +628,8 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, priority: { type: 'number', description: 'Task priority (0-10)' }, percentComplete: { type: 'number', description: 'Task completion percentage (0-100)' }, etag: { type: 'string', description: 'ETag for update/delete operations' }, - checklist: { type: 'string', description: 'Checklist items as JSON' }, - references: { type: 'string', description: 'References as JSON' }, + checklist: { type: 'json', description: 'Checklist items as JSON' }, + references: { type: 'json', description: 'References as JSON' }, previewType: { type: 'string', description: 'Preview type for task details' }, }, outputs: { diff --git a/apps/sim/blocks/blocks/mongodb.ts b/apps/sim/blocks/blocks/mongodb.ts index 0685fee4f7..d527c44f74 100644 --- a/apps/sim/blocks/blocks/mongodb.ts +++ b/apps/sim/blocks/blocks/mongodb.ts @@ -898,13 +898,13 @@ Return ONLY the MongoDB query filter as valid JSON - no explanations, no markdow authSource: { type: 'string', description: 'Authentication database' }, ssl: { type: 'string', description: 'SSL mode' }, collection: { type: 'string', description: 'Collection name' }, - query: { type: 'string', description: 'Query filter as JSON string' }, + query: { type: 'json', description: 'Query filter' }, limit: { type: 'number', description: 'Limit number of documents' }, - sort: { type: 'string', description: 'Sort criteria as JSON string' }, + sort: { type: 'json', description: 'Sort criteria' }, documents: { type: 'json', description: 'Documents to insert' }, - filter: { type: 'string', description: 'Filter criteria as JSON string' }, - update: { type: 'string', description: 'Update operations as JSON string' }, - pipeline: { type: 'string', description: 'Aggregation pipeline as JSON string' }, + filter: { type: 'json', description: 'Filter criteria' }, + update: { type: 'json', description: 'Update operations' }, + pipeline: { type: 'json', description: 'Aggregation pipeline' }, upsert: { type: 'boolean', description: 'Create document if not found' }, multi: { type: 'boolean', description: 'Operate on multiple documents' }, }, diff --git a/apps/sim/blocks/blocks/notion.ts b/apps/sim/blocks/blocks/notion.ts index 9bc6e6bf38..48193465e6 100644 --- a/apps/sim/blocks/blocks/notion.ts +++ b/apps/sim/blocks/blocks/notion.ts @@ -369,12 +369,14 @@ export const NotionBlock: BlockConfig = { title: { type: 'string', description: 'Page title' }, // Query database inputs databaseId: { type: 'string', description: 'Database identifier' }, - filter: { type: 'string', description: 'Filter criteria' }, - sorts: { type: 'string', description: 'Sort criteria' }, + filter: { type: 'json', description: 'Filter criteria' }, + sorts: { type: 'json', description: 'Sort criteria' }, pageSize: { type: 'number', description: 'Page size limit' }, // Search inputs query: { type: 'string', description: 'Search query' }, filterType: { type: 'string', description: 'Filter type' }, + // Create/update inputs + properties: { type: 'json', description: 'Page or database properties' }, }, outputs: { // Common outputs across all Notion operations diff --git a/apps/sim/blocks/blocks/posthog.ts b/apps/sim/blocks/blocks/posthog.ts index fc23c70450..743ab38cd7 100644 --- a/apps/sim/blocks/blocks/posthog.ts +++ b/apps/sim/blocks/blocks/posthog.ts @@ -1291,11 +1291,13 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, // Core Data event: { type: 'string', description: 'Event name' }, distinctId: { type: 'string', description: 'Unique user identifier' }, - properties: { type: 'string', description: 'Event properties as JSON' }, + properties: { type: 'json', description: 'Event properties as JSON' }, + personProperties: { type: 'json', description: 'Person properties as JSON' }, + groupProperties: { type: 'json', description: 'Group properties as JSON' }, timestamp: { type: 'string', description: 'Event timestamp (ISO 8601)' }, - batch: { type: 'string', description: 'Batch events as JSON array' }, + batch: { type: 'json', description: 'Batch events as JSON array' }, query: { type: 'string', description: 'HogQL query or JSON object' }, - values: { type: 'string', description: 'Query parameters' }, + values: { type: 'json', description: 'Query parameters' }, // IDs personId: { type: 'string', description: 'Person ID' }, insightId: { type: 'string', description: 'Insight ID' }, @@ -1313,16 +1315,20 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, name: { type: 'string', description: 'Name' }, description: { type: 'string', description: 'Description' }, key: { type: 'string', description: 'Feature flag key' }, - filters: { type: 'string', description: 'Filters as JSON' }, + filters: { type: 'json', description: 'Filters as JSON' }, active: { type: 'boolean', description: 'Whether flag is active' }, rolloutPercentage: { type: 'number', description: 'Rollout percentage (0-100)' }, - groups: { type: 'string', description: 'Cohort groups as JSON' }, + groups: { type: 'json', description: 'Cohort groups as JSON' }, content: { type: 'string', description: 'Annotation content' }, dateMarker: { type: 'string', description: 'Annotation date' }, scope: { type: 'string', description: 'Annotation scope' }, featureFlagKey: { type: 'string', description: 'Feature flag key for experiment' }, - parameters: { type: 'string', description: 'Experiment parameters as JSON' }, - questions: { type: 'string', description: 'Survey questions as JSON array' }, + parameters: { type: 'json', description: 'Experiment parameters as JSON' }, + variants: { type: 'json', description: 'Experiment variants as JSON' }, + questions: { type: 'json', description: 'Survey questions as JSON array' }, + appearance: { type: 'json', description: 'Survey appearance as JSON' }, + conditions: { type: 'json', description: 'Survey conditions as JSON' }, + targetingFlagFilters: { type: 'json', description: 'Targeting flag filters as JSON' }, surveyType: { type: 'string', description: 'Survey type (popover or api)' }, // List parameters limit: { type: 'number', description: 'Number of results to return' }, diff --git a/apps/sim/blocks/blocks/salesforce.ts b/apps/sim/blocks/blocks/salesforce.ts index e5f077e5f6..e07415186b 100644 --- a/apps/sim/blocks/blocks/salesforce.ts +++ b/apps/sim/blocks/blocks/salesforce.ts @@ -628,6 +628,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n inputs: { operation: { type: 'string', description: 'Operation to perform' }, credential: { type: 'string', description: 'Salesforce credential' }, + filters: { type: 'json', description: 'Report filters' }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, diff --git a/apps/sim/blocks/blocks/sentry.ts b/apps/sim/blocks/blocks/sentry.ts index 558f974b8c..1f8796f4cf 100644 --- a/apps/sim/blocks/blocks/sentry.ts +++ b/apps/sim/blocks/blocks/sentry.ts @@ -663,7 +663,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, ref: { type: 'string', description: 'Git reference' }, url: { type: 'string', description: 'URL' }, dateReleased: { type: 'string', description: 'Release date' }, - commits: { type: 'string', description: 'Commits JSON' }, + commits: { type: 'json', description: 'Commits JSON' }, environment: { type: 'string', description: 'Environment name' }, dateStarted: { type: 'string', description: 'Deploy start time' }, dateFinished: { type: 'string', description: 'Deploy finish time' }, diff --git a/apps/sim/blocks/blocks/sharepoint.ts b/apps/sim/blocks/blocks/sharepoint.ts index 5fe1dfb6df..35a17c5b83 100644 --- a/apps/sim/blocks/blocks/sharepoint.ts +++ b/apps/sim/blocks/blocks/sharepoint.ts @@ -480,7 +480,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, credential: { type: 'string', description: 'Microsoft account credential' }, pageName: { type: 'string', description: 'Page name' }, columnDefinitions: { - type: 'string', + type: 'json', description: 'Column definitions for list creation (JSON array)', }, pageTitle: { type: 'string', description: 'Page title' }, @@ -496,7 +496,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, includeColumns: { type: 'boolean', description: 'Include columns in response' }, includeItems: { type: 'boolean', description: 'Include items in response' }, listItemId: { type: 'string', description: 'List item ID' }, - listItemFields: { type: 'string', description: 'List item fields' }, + listItemFields: { type: 'json', description: 'List item fields' }, driveId: { type: 'string', description: 'Document library (drive) ID' }, folderPath: { type: 'string', description: 'Folder path for file upload' }, fileName: { type: 'string', description: 'File name override' }, diff --git a/apps/sim/blocks/blocks/tinybird.ts b/apps/sim/blocks/blocks/tinybird.ts index 436543de76..6ca157bdbf 100644 --- a/apps/sim/blocks/blocks/tinybird.ts +++ b/apps/sim/blocks/blocks/tinybird.ts @@ -163,7 +163,7 @@ export const TinybirdBlock: BlockConfig = { description: 'Name of the Tinybird Data Source', }, data: { - type: 'string', + type: 'json', description: 'Data to send as JSON or NDJSON string', }, wait: { type: 'boolean', description: 'Wait for database acknowledgment' }, diff --git a/apps/sim/blocks/blocks/zendesk.ts b/apps/sim/blocks/blocks/zendesk.ts index 687f87819b..3ffe78c2d0 100644 --- a/apps/sim/blocks/blocks/zendesk.ts +++ b/apps/sim/blocks/blocks/zendesk.ts @@ -624,6 +624,10 @@ Return ONLY the search query - no explanations.`, email: { type: 'string', description: 'Zendesk email address' }, apiToken: { type: 'string', description: 'Zendesk API token' }, subdomain: { type: 'string', description: 'Zendesk subdomain' }, + customFields: { type: 'json', description: 'Custom fields for ticket' }, + tickets: { type: 'json', description: 'Ticket data' }, + users: { type: 'json', description: 'User data' }, + organizations: { type: 'json', description: 'Organization data' }, }, outputs: { // Ticket operations - list diff --git a/apps/sim/executor/execution/block-executor.ts b/apps/sim/executor/execution/block-executor.ts index f159e4db0d..ac6e09d2e3 100644 --- a/apps/sim/executor/execution/block-executor.ts +++ b/apps/sim/executor/execution/block-executor.ts @@ -28,6 +28,7 @@ import type { } from '@/executor/types' import { streamingResponseFormatProcessor } from '@/executor/utils' import { buildBlockExecutionError, normalizeError } from '@/executor/utils/errors' +import { isJSONString } from '@/executor/utils/json' import { filterOutputForLog } from '@/executor/utils/output-filter' import { validateBlockType } from '@/executor/utils/permission-check' import type { VariableResolver } from '@/executor/variables/resolver' @@ -86,7 +87,7 @@ export class BlockExecutor { resolvedInputs = this.resolver.resolveInputs(ctx, node.id, block.config.params, block) if (blockLog) { - blockLog.input = resolvedInputs + blockLog.input = this.parseJsonInputs(resolvedInputs) } } catch (error) { cleanupSelfReference?.() @@ -157,7 +158,14 @@ export class BlockExecutor { const displayOutput = filterOutputForLog(block.metadata?.id || '', normalizedOutput, { block, }) - this.callOnBlockComplete(ctx, node, block, resolvedInputs, displayOutput, duration) + this.callOnBlockComplete( + ctx, + node, + block, + this.parseJsonInputs(resolvedInputs), + displayOutput, + duration + ) } return normalizedOutput @@ -233,7 +241,7 @@ export class BlockExecutor { blockLog.durationMs = duration blockLog.success = false blockLog.error = errorMessage - blockLog.input = input + blockLog.input = this.parseJsonInputs(input) blockLog.output = filterOutputForLog(block.metadata?.id || '', errorOutput, { block }) } @@ -248,7 +256,14 @@ export class BlockExecutor { if (!isSentinel) { const displayOutput = filterOutputForLog(block.metadata?.id || '', errorOutput, { block }) - this.callOnBlockComplete(ctx, node, block, input, displayOutput, duration) + this.callOnBlockComplete( + ctx, + node, + block, + this.parseJsonInputs(input), + displayOutput, + duration + ) } const hasErrorPort = this.hasErrorPortEdge(node) @@ -336,6 +351,34 @@ export class BlockExecutor { return { result: output } } + /** + * Parse JSON string inputs to objects for log display only. + * Attempts to parse any string that looks like JSON. + * Returns a new object - does not mutate the original inputs. + */ + private parseJsonInputs(inputs: Record): Record { + let result = inputs + let hasChanges = false + + for (const [key, value] of Object.entries(inputs)) { + if (typeof value !== 'string' || !isJSONString(value)) { + continue + } + + try { + if (!hasChanges) { + result = { ...inputs } + hasChanges = true + } + result[key] = JSON.parse(value.trim()) + } catch { + // Not valid JSON, keep original string + } + } + + return result + } + private callOnBlockStart(ctx: ExecutionContext, node: DAGNode, block: SerializedBlock): void { const blockId = node.id const blockName = block.metadata?.name ?? blockId From 4b7c055e1c7adad2fa6de6a5671ca95df44298b8 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 27 Jan 2026 17:19:25 -0800 Subject: [PATCH 2/6] fix sheets typing --- apps/sim/blocks/blocks/google_sheets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index 29737a7b4c..49027230c2 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -269,7 +269,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, credential: { type: 'string', description: 'Google Sheets access token' }, spreadsheetId: { type: 'string', description: 'Spreadsheet identifier' }, manualSpreadsheetId: { type: 'string', description: 'Manual spreadsheet identifier' }, - range: { type: 'json', description: 'Cell range' }, + range: { type: 'string', description: 'Cell range' }, values: { type: 'json', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, insertDataOption: { type: 'string', description: 'Data insertion option' }, From 2daf76d395afd36251b36177d10d1dda4e6aee60 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 27 Jan 2026 17:21:51 -0800 Subject: [PATCH 3/6] add reference comment --- apps/sim/executor/execution/block-executor.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/sim/executor/execution/block-executor.ts b/apps/sim/executor/execution/block-executor.ts index ac6e09d2e3..e73f573231 100644 --- a/apps/sim/executor/execution/block-executor.ts +++ b/apps/sim/executor/execution/block-executor.ts @@ -361,6 +361,8 @@ export class BlockExecutor { let hasChanges = false for (const [key, value] of Object.entries(inputs)) { + // isJSONString is a quick heuristic (checks for { or [), not a validator. + // Invalid JSON is safely caught below - this just avoids JSON.parse on every string. if (typeof value !== 'string' || !isJSONString(value)) { continue } From 16b35da1fb581134f752a768591ec9518154f004 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 27 Jan 2026 17:25:53 -0800 Subject: [PATCH 4/6] fix models --- apps/sim/providers/azure-openai/index.ts | 2 +- apps/sim/providers/cerebras/index.ts | 2 +- apps/sim/providers/deepseek/index.ts | 2 +- apps/sim/providers/gemini/core.ts | 2 +- apps/sim/providers/groq/index.ts | 2 +- apps/sim/providers/mistral/index.ts | 2 +- apps/sim/providers/ollama/index.ts | 2 +- apps/sim/providers/openai/index.ts | 2 +- apps/sim/providers/openrouter/index.ts | 2 +- apps/sim/providers/vllm/index.ts | 2 +- apps/sim/providers/xai/index.ts | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/sim/providers/azure-openai/index.ts b/apps/sim/providers/azure-openai/index.ts index f912e92be7..11a5813607 100644 --- a/apps/sim/providers/azure-openai/index.ts +++ b/apps/sim/providers/azure-openai/index.ts @@ -102,7 +102,7 @@ export const azureOpenAIProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens if (request.reasoningEffort !== undefined) payload.reasoning_effort = request.reasoningEffort if (request.verbosity !== undefined) payload.verbosity = request.verbosity diff --git a/apps/sim/providers/cerebras/index.ts b/apps/sim/providers/cerebras/index.ts index 3953c67155..4634bee2a0 100644 --- a/apps/sim/providers/cerebras/index.ts +++ b/apps/sim/providers/cerebras/index.ts @@ -77,7 +77,7 @@ export const cerebrasProvider: ProviderConfig = { messages: allMessages, } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens if (request.responseFormat) { payload.response_format = { type: 'json_schema', diff --git a/apps/sim/providers/deepseek/index.ts b/apps/sim/providers/deepseek/index.ts index 2aa92b04fe..026342498a 100644 --- a/apps/sim/providers/deepseek/index.ts +++ b/apps/sim/providers/deepseek/index.ts @@ -81,7 +81,7 @@ export const deepseekProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens let preparedTools: ReturnType | null = null diff --git a/apps/sim/providers/gemini/core.ts b/apps/sim/providers/gemini/core.ts index a7aca1aaa1..2dca22e5b0 100644 --- a/apps/sim/providers/gemini/core.ts +++ b/apps/sim/providers/gemini/core.ts @@ -349,7 +349,7 @@ export async function executeGeminiRequest( if (request.temperature !== undefined) { geminiConfig.temperature = request.temperature } - if (request.maxTokens !== undefined) { + if (request.maxTokens != null) { geminiConfig.maxOutputTokens = request.maxTokens } if (systemInstruction) { diff --git a/apps/sim/providers/groq/index.ts b/apps/sim/providers/groq/index.ts index c5dad01ef6..6f8720c4f6 100644 --- a/apps/sim/providers/groq/index.ts +++ b/apps/sim/providers/groq/index.ts @@ -74,7 +74,7 @@ export const groqProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens if (request.responseFormat) { payload.response_format = { diff --git a/apps/sim/providers/mistral/index.ts b/apps/sim/providers/mistral/index.ts index 736b11c246..f99a3e210e 100644 --- a/apps/sim/providers/mistral/index.ts +++ b/apps/sim/providers/mistral/index.ts @@ -91,7 +91,7 @@ export const mistralProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens if (request.responseFormat) { payload.response_format = { diff --git a/apps/sim/providers/ollama/index.ts b/apps/sim/providers/ollama/index.ts index 7b73d1f188..921c1afd09 100644 --- a/apps/sim/providers/ollama/index.ts +++ b/apps/sim/providers/ollama/index.ts @@ -105,7 +105,7 @@ export const ollamaProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens if (request.responseFormat) { payload.response_format = { diff --git a/apps/sim/providers/openai/index.ts b/apps/sim/providers/openai/index.ts index 0d7342fc98..2c46f8e17d 100644 --- a/apps/sim/providers/openai/index.ts +++ b/apps/sim/providers/openai/index.ts @@ -81,7 +81,7 @@ export const openaiProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens if (request.reasoningEffort !== undefined) payload.reasoning_effort = request.reasoningEffort if (request.verbosity !== undefined) payload.verbosity = request.verbosity diff --git a/apps/sim/providers/openrouter/index.ts b/apps/sim/providers/openrouter/index.ts index d937e3d0e1..bf54a64576 100644 --- a/apps/sim/providers/openrouter/index.ts +++ b/apps/sim/providers/openrouter/index.ts @@ -121,7 +121,7 @@ export const openRouterProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens let preparedTools: ReturnType | null = null let hasActiveTools = false diff --git a/apps/sim/providers/vllm/index.ts b/apps/sim/providers/vllm/index.ts index 4af4ae9d7b..192f57fbb7 100644 --- a/apps/sim/providers/vllm/index.ts +++ b/apps/sim/providers/vllm/index.ts @@ -135,7 +135,7 @@ export const vllmProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens !== undefined) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_tokens = request.maxTokens if (request.responseFormat) { payload.response_format = { diff --git a/apps/sim/providers/xai/index.ts b/apps/sim/providers/xai/index.ts index 72602ec508..e6ba237044 100644 --- a/apps/sim/providers/xai/index.ts +++ b/apps/sim/providers/xai/index.ts @@ -92,7 +92,7 @@ export const xAIProvider: ProviderConfig = { } if (request.temperature !== undefined) basePayload.temperature = request.temperature - if (request.maxTokens !== undefined) basePayload.max_tokens = request.maxTokens + if (request.maxTokens != null) basePayload.max_tokens = request.maxTokens let preparedTools: ReturnType | null = null if (tools?.length) { From e5b54b5d9c18e8a156560c2c6e08bd4ba9fdb2cb Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 27 Jan 2026 17:29:01 -0800 Subject: [PATCH 5/6] revert blocks changes --- apps/sim/blocks/blocks/apify.ts | 2 +- apps/sim/blocks/blocks/apollo.ts | 20 - apps/sim/blocks/blocks/clerk.ts | 393 ++++++++++++++++++++ apps/sim/blocks/blocks/cursor.ts | 2 +- apps/sim/blocks/blocks/elasticsearch.ts | 12 +- apps/sim/blocks/blocks/fireflies.ts | 2 +- apps/sim/blocks/blocks/github.ts | 8 +- apps/sim/blocks/blocks/google_sheets.ts | 8 +- apps/sim/blocks/blocks/google_slides.ts | 4 +- apps/sim/blocks/blocks/grafana.ts | 4 +- apps/sim/blocks/blocks/incidentio.ts | 1 - apps/sim/blocks/blocks/intercom.ts | 3 - apps/sim/blocks/blocks/knowledge.ts | 6 +- apps/sim/blocks/blocks/mailchimp.ts | 9 - apps/sim/blocks/blocks/mailgun.ts | 2 +- apps/sim/blocks/blocks/microsoft_excel.ts | 4 +- apps/sim/blocks/blocks/microsoft_planner.ts | 4 +- apps/sim/blocks/blocks/mongodb.ts | 10 +- apps/sim/blocks/blocks/notion.ts | 6 +- apps/sim/blocks/blocks/posthog.ts | 20 +- apps/sim/blocks/blocks/salesforce.ts | 1 - apps/sim/blocks/blocks/sentry.ts | 2 +- apps/sim/blocks/blocks/sharepoint.ts | 4 +- apps/sim/blocks/blocks/tinybird.ts | 2 +- apps/sim/blocks/blocks/zendesk.ts | 4 - 25 files changed, 441 insertions(+), 92 deletions(-) create mode 100644 apps/sim/blocks/blocks/clerk.ts diff --git a/apps/sim/blocks/blocks/apify.ts b/apps/sim/blocks/blocks/apify.ts index e7bb264231..14bc2fc9a9 100644 --- a/apps/sim/blocks/blocks/apify.ts +++ b/apps/sim/blocks/blocks/apify.ts @@ -151,7 +151,7 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'Apify API token' }, actorId: { type: 'string', description: 'Actor ID or username/actor-name' }, - input: { type: 'json', description: 'Actor input as JSON string' }, + input: { type: 'string', description: 'Actor input as JSON string' }, timeout: { type: 'number', description: 'Timeout in seconds' }, build: { type: 'string', description: 'Actor build version' }, waitForFinish: { type: 'number', description: 'Initial wait time in seconds' }, diff --git a/apps/sim/blocks/blocks/apollo.ts b/apps/sim/blocks/blocks/apollo.ts index 8dfa2f7f31..240bc29dec 100644 --- a/apps/sim/blocks/blocks/apollo.ts +++ b/apps/sim/blocks/blocks/apollo.ts @@ -776,26 +776,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes }, inputs: { operation: { type: 'string', description: 'Apollo operation to perform' }, - person_titles: { type: 'json', description: 'Array of job titles' }, - person_locations: { type: 'json', description: 'Array of locations' }, - organization_names: { type: 'json', description: 'Array of organization names' }, - person_seniorities: { type: 'json', description: 'Array of seniority levels' }, - contact_stage_ids: { type: 'json', description: 'Array of contact stage IDs' }, - organization_locations: { type: 'json', description: 'Array of organization locations' }, - organization_num_employees_ranges: { - type: 'json', - description: 'Array of employee count ranges', - }, - q_organization_keyword_tags: { type: 'json', description: 'Array of keyword tags' }, - account_stage_ids: { type: 'json', description: 'Array of account stage IDs' }, - people: { type: 'json', description: 'People data for bulk enrichment' }, - organizations: { type: 'json', description: 'Organizations data for bulk enrichment' }, - contacts: { type: 'json', description: 'Contacts data for bulk operations' }, - accounts: { type: 'json', description: 'Accounts data for bulk operations' }, - contact_ids: { type: 'json', description: 'Array of contact IDs' }, - account_ids: { type: 'json', description: 'Array of account IDs' }, - stage_ids: { type: 'json', description: 'Array of stage IDs' }, - owner_ids: { type: 'json', description: 'Array of owner IDs' }, }, outputs: { success: { type: 'boolean', description: 'Whether the operation was successful' }, diff --git a/apps/sim/blocks/blocks/clerk.ts b/apps/sim/blocks/blocks/clerk.ts new file mode 100644 index 0000000000..620f2709c1 --- /dev/null +++ b/apps/sim/blocks/blocks/clerk.ts @@ -0,0 +1,393 @@ +import { ClerkIcon } from '@/components/icons' +import type { BlockConfig } from '@/blocks/types' +import type { ClerkResponse } from '@/tools/clerk/types' + +export const ClerkBlock: BlockConfig = { + type: 'clerk', + name: 'Clerk', + description: 'Manage users, organizations, and sessions in Clerk', + longDescription: + 'Integrate Clerk authentication and user management into your workflow. Create, update, delete, and list users. Manage organizations and their memberships. Monitor and control user sessions.', + docsLink: 'https://docs.sim.ai/tools/clerk', + category: 'tools', + bgColor: '#131316', + icon: ClerkIcon, + + subBlocks: [ + { + id: 'operation', + title: 'Operation', + type: 'dropdown', + options: [ + { label: 'List Users', id: 'clerk_list_users' }, + { label: 'Get User', id: 'clerk_get_user' }, + { label: 'Create User', id: 'clerk_create_user' }, + { label: 'Update User', id: 'clerk_update_user' }, + { label: 'Delete User', id: 'clerk_delete_user' }, + { label: 'List Organizations', id: 'clerk_list_organizations' }, + { label: 'Get Organization', id: 'clerk_get_organization' }, + { label: 'Create Organization', id: 'clerk_create_organization' }, + { label: 'List Sessions', id: 'clerk_list_sessions' }, + { label: 'Get Session', id: 'clerk_get_session' }, + { label: 'Revoke Session', id: 'clerk_revoke_session' }, + ], + value: () => 'clerk_list_users', + }, + { + id: 'secretKey', + title: 'Secret Key', + type: 'short-input', + password: true, + placeholder: 'sk_live_... or sk_test_...', + required: true, + }, + // List Users params + { + id: 'query', + title: 'Search Query', + type: 'short-input', + placeholder: 'Search by email, phone, username, or name', + condition: { field: 'operation', value: 'clerk_list_users' }, + }, + { + id: 'emailAddressFilter', + title: 'Email Filter', + type: 'short-input', + placeholder: 'Filter by email (comma-separated)', + condition: { field: 'operation', value: 'clerk_list_users' }, + }, + { + id: 'usernameFilter', + title: 'Username Filter', + type: 'short-input', + placeholder: 'Filter by username (comma-separated)', + condition: { field: 'operation', value: 'clerk_list_users' }, + }, + // Get User params + { + id: 'userId', + title: 'User ID', + type: 'short-input', + placeholder: 'user_...', + condition: { + field: 'operation', + value: ['clerk_get_user', 'clerk_update_user', 'clerk_delete_user'], + }, + required: { + field: 'operation', + value: ['clerk_get_user', 'clerk_update_user', 'clerk_delete_user'], + }, + }, + // Create/Update User params + { + id: 'emailAddress', + title: 'Email Address', + type: 'short-input', + placeholder: 'user@example.com (comma-separated for multiple)', + condition: { field: 'operation', value: 'clerk_create_user' }, + }, + { + id: 'phoneNumber', + title: 'Phone Number', + type: 'short-input', + placeholder: '+1234567890 (comma-separated for multiple)', + condition: { field: 'operation', value: 'clerk_create_user' }, + }, + { + id: 'username', + title: 'Username', + type: 'short-input', + placeholder: 'johndoe', + condition: { field: 'operation', value: ['clerk_create_user', 'clerk_update_user'] }, + }, + { + id: 'password', + title: 'Password', + type: 'short-input', + password: true, + placeholder: 'Minimum 8 characters', + condition: { field: 'operation', value: ['clerk_create_user', 'clerk_update_user'] }, + }, + { + id: 'firstName', + title: 'First Name', + type: 'short-input', + placeholder: 'John', + condition: { field: 'operation', value: ['clerk_create_user', 'clerk_update_user'] }, + }, + { + id: 'lastName', + title: 'Last Name', + type: 'short-input', + placeholder: 'Doe', + condition: { field: 'operation', value: ['clerk_create_user', 'clerk_update_user'] }, + }, + { + id: 'externalId', + title: 'External ID', + type: 'short-input', + placeholder: 'Your system user ID', + condition: { field: 'operation', value: ['clerk_create_user', 'clerk_update_user'] }, + }, + { + id: 'publicMetadata', + title: 'Public Metadata', + type: 'code', + language: 'json', + placeholder: '{"role": "admin"}', + condition: { field: 'operation', value: ['clerk_create_user', 'clerk_update_user'] }, + }, + { + id: 'privateMetadata', + title: 'Private Metadata', + type: 'code', + language: 'json', + placeholder: '{"internalId": "123"}', + condition: { field: 'operation', value: ['clerk_create_user', 'clerk_update_user'] }, + }, + // Organization params + { + id: 'orgQuery', + title: 'Search Query', + type: 'short-input', + placeholder: 'Search by name, ID, or slug', + condition: { field: 'operation', value: 'clerk_list_organizations' }, + }, + { + id: 'includeMembersCount', + title: 'Include Members Count', + type: 'switch', + condition: { field: 'operation', value: 'clerk_list_organizations' }, + }, + { + id: 'organizationId', + title: 'Organization ID', + type: 'short-input', + placeholder: 'org_... or slug', + condition: { field: 'operation', value: 'clerk_get_organization' }, + required: { field: 'operation', value: 'clerk_get_organization' }, + }, + { + id: 'orgName', + title: 'Organization Name', + type: 'short-input', + placeholder: 'Acme Corp', + condition: { field: 'operation', value: 'clerk_create_organization' }, + required: { field: 'operation', value: 'clerk_create_organization' }, + }, + { + id: 'createdBy', + title: 'Creator User ID', + type: 'short-input', + placeholder: 'user_... (will become admin)', + condition: { field: 'operation', value: 'clerk_create_organization' }, + required: { field: 'operation', value: 'clerk_create_organization' }, + }, + { + id: 'slug', + title: 'Slug', + type: 'short-input', + placeholder: 'acme-corp', + condition: { field: 'operation', value: 'clerk_create_organization' }, + }, + { + id: 'maxAllowedMemberships', + title: 'Max Members', + type: 'short-input', + placeholder: '0 for unlimited', + condition: { field: 'operation', value: 'clerk_create_organization' }, + }, + // Session params + { + id: 'sessionUserId', + title: 'User ID', + type: 'short-input', + placeholder: 'user_...', + condition: { field: 'operation', value: 'clerk_list_sessions' }, + }, + { + id: 'clientId', + title: 'Client ID', + type: 'short-input', + placeholder: 'client_...', + condition: { field: 'operation', value: 'clerk_list_sessions' }, + }, + { + id: 'sessionStatus', + title: 'Status', + type: 'dropdown', + options: [ + { label: 'All', id: '' }, + { label: 'Active', id: 'active' }, + { label: 'Ended', id: 'ended' }, + { label: 'Expired', id: 'expired' }, + { label: 'Revoked', id: 'revoked' }, + { label: 'Abandoned', id: 'abandoned' }, + { label: 'Pending', id: 'pending' }, + ], + value: () => '', + condition: { field: 'operation', value: 'clerk_list_sessions' }, + }, + { + id: 'sessionId', + title: 'Session ID', + type: 'short-input', + placeholder: 'sess_...', + condition: { field: 'operation', value: ['clerk_get_session', 'clerk_revoke_session'] }, + required: { field: 'operation', value: ['clerk_get_session', 'clerk_revoke_session'] }, + }, + // Pagination params (common) + { + id: 'limit', + title: 'Limit', + type: 'short-input', + placeholder: 'Results per page (1-500, default: 10)', + condition: { + field: 'operation', + value: ['clerk_list_users', 'clerk_list_organizations', 'clerk_list_sessions'], + }, + }, + { + id: 'offset', + title: 'Offset', + type: 'short-input', + placeholder: 'Skip N results for pagination', + condition: { + field: 'operation', + value: ['clerk_list_users', 'clerk_list_organizations', 'clerk_list_sessions'], + }, + }, + ], + + tools: { + access: [ + 'clerk_list_users', + 'clerk_get_user', + 'clerk_create_user', + 'clerk_update_user', + 'clerk_delete_user', + 'clerk_list_organizations', + 'clerk_get_organization', + 'clerk_create_organization', + 'clerk_list_sessions', + 'clerk_get_session', + 'clerk_revoke_session', + ], + config: { + tool: (params) => params.operation as string, + params: (params) => { + const { + operation, + secretKey, + emailAddressFilter, + usernameFilter, + orgQuery, + orgName, + sessionUserId, + sessionStatus, + publicMetadata, + privateMetadata, + maxAllowedMemberships, + ...rest + } = params + + const cleanParams: Record = { + secretKey, + } + + // Map UI fields to API params based on operation + switch (operation) { + case 'clerk_list_users': + if (emailAddressFilter) cleanParams.emailAddress = emailAddressFilter + if (usernameFilter) cleanParams.username = usernameFilter + break + case 'clerk_create_user': + case 'clerk_update_user': + if (publicMetadata) { + cleanParams.publicMetadata = + typeof publicMetadata === 'string' ? JSON.parse(publicMetadata) : publicMetadata + } + if (privateMetadata) { + cleanParams.privateMetadata = + typeof privateMetadata === 'string' ? JSON.parse(privateMetadata) : privateMetadata + } + break + case 'clerk_list_organizations': + if (orgQuery) cleanParams.query = orgQuery + break + case 'clerk_create_organization': + if (orgName) cleanParams.name = orgName + if (maxAllowedMemberships) + cleanParams.maxAllowedMemberships = Number(maxAllowedMemberships) + break + case 'clerk_list_sessions': + if (sessionUserId) cleanParams.userId = sessionUserId + if (sessionStatus) cleanParams.status = sessionStatus + break + } + + // Add remaining params that don't need mapping + Object.entries(rest).forEach(([key, value]) => { + if (value !== undefined && value !== null && value !== '') { + cleanParams[key] = value + } + }) + + return cleanParams + }, + }, + }, + + inputs: { + operation: { type: 'string', description: 'Operation to perform' }, + secretKey: { type: 'string', description: 'Clerk Secret Key' }, + userId: { type: 'string', description: 'User ID' }, + organizationId: { type: 'string', description: 'Organization ID or slug' }, + sessionId: { type: 'string', description: 'Session ID' }, + query: { type: 'string', description: 'Search query' }, + limit: { type: 'number', description: 'Results per page' }, + offset: { type: 'number', description: 'Pagination offset' }, + }, + + outputs: { + // List outputs (arrays stored as json for block compatibility) + users: { type: 'json', description: 'Array of user objects' }, + organizations: { type: 'json', description: 'Array of organization objects' }, + sessions: { type: 'json', description: 'Array of session objects' }, + // Single entity fields (destructured from get/create/update operations) + id: { type: 'string', description: 'Resource ID (user, organization, or session)' }, + name: { type: 'string', description: 'Organization name' }, + slug: { type: 'string', description: 'Organization slug' }, + username: { type: 'string', description: 'Username' }, + firstName: { type: 'string', description: 'First name' }, + lastName: { type: 'string', description: 'Last name' }, + imageUrl: { type: 'string', description: 'Profile image URL' }, + hasImage: { type: 'boolean', description: 'Whether resource has an image' }, + emailAddresses: { type: 'json', description: 'User email addresses' }, + phoneNumbers: { type: 'json', description: 'User phone numbers' }, + primaryEmailAddressId: { type: 'string', description: 'Primary email address ID' }, + primaryPhoneNumberId: { type: 'string', description: 'Primary phone number ID' }, + externalId: { type: 'string', description: 'External system ID' }, + passwordEnabled: { type: 'boolean', description: 'Whether password is enabled' }, + twoFactorEnabled: { type: 'boolean', description: 'Whether 2FA is enabled' }, + banned: { type: 'boolean', description: 'Whether user is banned' }, + locked: { type: 'boolean', description: 'Whether user is locked' }, + userId: { type: 'string', description: 'User ID (for sessions)' }, + clientId: { type: 'string', description: 'Client ID (for sessions)' }, + status: { type: 'string', description: 'Session status' }, + lastActiveAt: { type: 'number', description: 'Last activity timestamp' }, + lastSignInAt: { type: 'number', description: 'Last sign-in timestamp' }, + membersCount: { type: 'number', description: 'Number of members' }, + maxAllowedMemberships: { type: 'number', description: 'Max allowed memberships' }, + adminDeleteEnabled: { type: 'boolean', description: 'Whether admin delete is enabled' }, + createdBy: { type: 'string', description: 'Creator user ID' }, + publicMetadata: { type: 'json', description: 'Public metadata' }, + // Common outputs + totalCount: { type: 'number', description: 'Total count for paginated results' }, + deleted: { type: 'boolean', description: 'Whether the resource was deleted' }, + object: { type: 'string', description: 'Object type' }, + createdAt: { type: 'number', description: 'Creation timestamp' }, + updatedAt: { type: 'number', description: 'Last update timestamp' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/blocks/blocks/cursor.ts b/apps/sim/blocks/blocks/cursor.ts index b9e068e039..3c96fc78e6 100644 --- a/apps/sim/blocks/blocks/cursor.ts +++ b/apps/sim/blocks/blocks/cursor.ts @@ -155,7 +155,7 @@ export const CursorBlock: BlockConfig = { ref: { type: 'string', description: 'Branch, tag, or commit reference' }, promptText: { type: 'string', description: 'Instruction text for the agent' }, followupPromptText: { type: 'string', description: 'Follow-up instruction text for the agent' }, - promptImages: { type: 'json', description: 'JSON array of image objects' }, + promptImages: { type: 'string', description: 'JSON array of image objects' }, model: { type: 'string', description: 'Model to use (empty for auto-selection)' }, branchName: { type: 'string', description: 'Custom branch name' }, autoCreatePr: { type: 'boolean', description: 'Auto-create PR when done' }, diff --git a/apps/sim/blocks/blocks/elasticsearch.ts b/apps/sim/blocks/blocks/elasticsearch.ts index 6988ab2532..25796eb742 100644 --- a/apps/sim/blocks/blocks/elasticsearch.ts +++ b/apps/sim/blocks/blocks/elasticsearch.ts @@ -489,16 +489,16 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, password: { type: 'string', description: 'Password for basic auth' }, index: { type: 'string', description: 'Index name' }, documentId: { type: 'string', description: 'Document ID' }, - document: { type: 'json', description: 'Document body as JSON' }, - query: { type: 'json', description: 'Search query as JSON' }, + document: { type: 'string', description: 'Document body as JSON' }, + query: { type: 'string', description: 'Search query as JSON' }, size: { type: 'number', description: 'Number of results' }, from: { type: 'number', description: 'Starting offset' }, - sort: { type: 'json', description: 'Sort specification as JSON' }, + sort: { type: 'string', description: 'Sort specification as JSON' }, sourceIncludes: { type: 'string', description: 'Fields to include' }, sourceExcludes: { type: 'string', description: 'Fields to exclude' }, - operations: { type: 'json', description: 'Bulk operations as NDJSON' }, - settings: { type: 'json', description: 'Index settings as JSON' }, - mappings: { type: 'json', description: 'Index mappings as JSON' }, + operations: { type: 'string', description: 'Bulk operations as NDJSON' }, + settings: { type: 'string', description: 'Index settings as JSON' }, + mappings: { type: 'string', description: 'Index mappings as JSON' }, refresh: { type: 'string', description: 'Refresh policy' }, waitForStatus: { type: 'string', description: 'Wait for cluster status' }, timeout: { type: 'string', description: 'Timeout for wait operations' }, diff --git a/apps/sim/blocks/blocks/fireflies.ts b/apps/sim/blocks/blocks/fireflies.ts index 13ea546cd3..b092471902 100644 --- a/apps/sim/blocks/blocks/fireflies.ts +++ b/apps/sim/blocks/blocks/fireflies.ts @@ -550,7 +550,7 @@ Return ONLY the summary text - no quotes, no labels.`, audioUrl: { type: 'string', description: 'Public URL to audio file' }, title: { type: 'string', description: 'Meeting title' }, language: { type: 'string', description: 'Language code for transcription' }, - attendees: { type: 'json', description: 'JSON array of attendees' }, + attendees: { type: 'string', description: 'JSON array of attendees' }, clientReferenceId: { type: 'string', description: 'Custom reference ID for tracking' }, meetingLink: { type: 'string', description: 'Meeting URL (Zoom, Meet, Teams)' }, meetingPassword: { type: 'string', description: 'Meeting password if required' }, diff --git a/apps/sim/blocks/blocks/github.ts b/apps/sim/blocks/blocks/github.ts index 2ea06f9770..4a2ae20a9d 100644 --- a/apps/sim/blocks/blocks/github.ts +++ b/apps/sim/blocks/blocks/github.ts @@ -1853,9 +1853,9 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, ref: { type: 'string', description: 'Branch, tag, or commit reference' }, // Branch parameters protected: { type: 'string', description: 'Protection status filter' }, - required_status_checks: { type: 'json', description: 'Required status checks JSON' }, + required_status_checks: { type: 'string', description: 'Required status checks JSON' }, enforce_admins: { type: 'boolean', description: 'Enforce for admins' }, - required_pull_request_reviews: { type: 'json', description: 'Required PR reviews JSON' }, + required_pull_request_reviews: { type: 'string', description: 'Required PR reviews JSON' }, // Issue parameters labels: { type: 'string', description: 'Comma-separated labels' }, assignees: { type: 'string', description: 'Comma-separated assignees' }, @@ -1868,7 +1868,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, workflow_id: { type: 'string', description: 'Workflow ID or filename' }, run_id: { type: 'number', description: 'Workflow run ID' }, status: { type: 'string', description: 'Status filter' }, - inputs: { type: 'json', description: 'Workflow inputs JSON' }, + inputs: { type: 'string', description: 'Workflow inputs JSON' }, // Project parameters owner_login: { type: 'string', description: 'Owner login' }, owner_type: { type: 'string', description: 'Owner type (user or org)' }, @@ -1888,7 +1888,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, // Gist parameters gist_id: { type: 'string', description: 'Gist ID' }, description: { type: 'string', description: 'Description' }, - files: { type: 'json', description: 'Files JSON object' }, + files: { type: 'string', description: 'Files JSON object' }, gist_public: { type: 'boolean', description: 'Public gist status' }, username: { type: 'string', description: 'GitHub username' }, // Fork parameters diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index 49027230c2..2598425848 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -270,7 +270,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, spreadsheetId: { type: 'string', description: 'Spreadsheet identifier' }, manualSpreadsheetId: { type: 'string', description: 'Manual spreadsheet identifier' }, range: { type: 'string', description: 'Cell range' }, - values: { type: 'json', description: 'Cell values data' }, + values: { type: 'string', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, insertDataOption: { type: 'string', description: 'Data insertion option' }, }, @@ -826,13 +826,13 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, sheetName: { type: 'string', description: 'Name of the sheet/tab' }, manualSheetName: { type: 'string', description: 'Manual sheet name entry' }, cellRange: { type: 'string', description: 'Cell range (e.g., A1:D10)' }, - values: { type: 'json', description: 'Cell values data' }, + values: { type: 'string', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, insertDataOption: { type: 'string', description: 'Data insertion option' }, title: { type: 'string', description: 'Title for new spreadsheet' }, sheetTitles: { type: 'string', description: 'Comma-separated sheet names for new spreadsheet' }, - ranges: { type: 'json', description: 'JSON array of ranges for batch operations' }, - batchData: { type: 'json', description: 'JSON array of data for batch update' }, + ranges: { type: 'string', description: 'JSON array of ranges for batch operations' }, + batchData: { type: 'string', description: 'JSON array of data for batch update' }, sheetId: { type: 'string', description: 'Numeric sheet ID for copy operation' }, destinationSpreadsheetId: { type: 'string', diff --git a/apps/sim/blocks/blocks/google_slides.ts b/apps/sim/blocks/blocks/google_slides.ts index 0697a3e4ff..016d04a74d 100644 --- a/apps/sim/blocks/blocks/google_slides.ts +++ b/apps/sim/blocks/blocks/google_slides.ts @@ -806,7 +806,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers, // Add slide operation layout: { type: 'string', description: 'Slide layout' }, insertionIndex: { type: 'number', description: 'Position to insert slide' }, - placeholderIdMappings: { type: 'json', description: 'JSON array of placeholder ID mappings' }, + placeholderIdMappings: { type: 'string', description: 'JSON array of placeholder ID mappings' }, // Add image operation pageObjectId: { type: 'string', description: 'Slide object ID for image' }, imageUrl: { type: 'string', description: 'Image URL' }, @@ -824,7 +824,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers, deleteObjectId: { type: 'string', description: 'Object ID to delete' }, // Duplicate object operation duplicateObjectId: { type: 'string', description: 'Object ID to duplicate' }, - duplicateObjectIds: { type: 'json', description: 'JSON object ID mappings' }, + duplicateObjectIds: { type: 'string', description: 'JSON object ID mappings' }, // Reorder slides operation reorderSlideIds: { type: 'string', description: 'Comma-separated slide IDs to move' }, reorderInsertionIndex: { type: 'number', description: 'New position for slides' }, diff --git a/apps/sim/blocks/blocks/grafana.ts b/apps/sim/blocks/blocks/grafana.ts index 81974b1a82..b748f5b0ec 100644 --- a/apps/sim/blocks/blocks/grafana.ts +++ b/apps/sim/blocks/blocks/grafana.ts @@ -657,7 +657,7 @@ Return ONLY the folder title - no explanations, no quotes, no extra text.`, title: { type: 'string', description: 'Dashboard or folder title' }, folderUid: { type: 'string', description: 'Folder UID' }, tags: { type: 'string', description: 'Comma-separated tags' }, - panels: { type: 'json', description: 'JSON array of panels' }, + panels: { type: 'string', description: 'JSON array of panels' }, message: { type: 'string', description: 'Commit message' }, query: { type: 'string', description: 'Search query' }, tag: { type: 'string', description: 'Filter by tag' }, @@ -666,7 +666,7 @@ Return ONLY the folder title - no explanations, no quotes, no extra text.`, alertTitle: { type: 'string', description: 'Alert rule title' }, ruleGroup: { type: 'string', description: 'Rule group name' }, condition: { type: 'string', description: 'Alert condition refId' }, - data: { type: 'json', description: 'Query data JSON' }, + data: { type: 'string', description: 'Query data JSON' }, forDuration: { type: 'string', description: 'Duration before firing' }, noDataState: { type: 'string', description: 'State on no data' }, execErrState: { type: 'string', description: 'State on error' }, diff --git a/apps/sim/blocks/blocks/incidentio.ts b/apps/sim/blocks/blocks/incidentio.ts index cff069511e..31f743258a 100644 --- a/apps/sim/blocks/blocks/incidentio.ts +++ b/apps/sim/blocks/blocks/incidentio.ts @@ -957,7 +957,6 @@ Return ONLY the JSON array - no explanations or markdown formatting.`, state: { type: 'string', description: 'Workflow state' }, // Schedule fields timezone: { type: 'string', description: 'Schedule timezone' }, - config: { type: 'json', description: 'Schedule configuration' }, // Custom field fields description: { type: 'string', description: 'Custom field description' }, field_type: { type: 'string', description: 'Custom field type' }, diff --git a/apps/sim/blocks/blocks/intercom.ts b/apps/sim/blocks/blocks/intercom.ts index 4c6bb16976..6919679b64 100644 --- a/apps/sim/blocks/blocks/intercom.ts +++ b/apps/sim/blocks/blocks/intercom.ts @@ -1393,9 +1393,6 @@ Return ONLY the numeric timestamp.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, accessToken: { type: 'string', description: 'Intercom API access token' }, - custom_attributes: { type: 'json', description: 'Custom attributes for contact' }, - ticket_attributes: { type: 'json', description: 'Ticket attributes' }, - contacts: { type: 'json', description: 'Contacts array' }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, diff --git a/apps/sim/blocks/blocks/knowledge.ts b/apps/sim/blocks/blocks/knowledge.ts index 115d74195c..722c4d7d8d 100644 --- a/apps/sim/blocks/blocks/knowledge.ts +++ b/apps/sim/blocks/blocks/knowledge.ts @@ -144,8 +144,10 @@ export const KnowledgeBlock: BlockConfig = { documentId: { type: 'string', description: 'Document identifier' }, content: { type: 'string', description: 'Content data' }, name: { type: 'string', description: 'Document name' }, - tagFilters: { type: 'json', description: 'Tag filter criteria' }, - documentTags: { type: 'json', description: 'Document tags' }, + // Dynamic tag filters for search + tagFilters: { type: 'string', description: 'Tag filter criteria' }, + // Document tags for create document (JSON string of tag objects) + documentTags: { type: 'string', description: 'Document tags' }, }, outputs: { results: { type: 'json', description: 'Search results' }, diff --git a/apps/sim/blocks/blocks/mailchimp.ts b/apps/sim/blocks/blocks/mailchimp.ts index d49890759c..147e61e575 100644 --- a/apps/sim/blocks/blocks/mailchimp.ts +++ b/apps/sim/blocks/blocks/mailchimp.ts @@ -1452,15 +1452,6 @@ Return ONLY the JSON array - no explanations or markdown.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'Mailchimp API key with server prefix' }, - contact: { type: 'json', description: 'Contact information JSON object' }, - campaignDefaults: { type: 'json', description: 'Campaign defaults JSON object' }, - campaignSettings: { type: 'json', description: 'Campaign settings JSON object' }, - recipients: { type: 'json', description: 'Recipients JSON object' }, - mergeFields: { type: 'json', description: 'Merge fields JSON object' }, - interests: { type: 'json', description: 'Interests JSON object' }, - tags: { type: 'json', description: 'Tags JSON array' }, - segmentOptions: { type: 'json', description: 'Segment options JSON object' }, - operations: { type: 'json', description: 'Batch operations JSON array' }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, diff --git a/apps/sim/blocks/blocks/mailgun.ts b/apps/sim/blocks/blocks/mailgun.ts index 2d76b6ec90..4fdee43095 100644 --- a/apps/sim/blocks/blocks/mailgun.ts +++ b/apps/sim/blocks/blocks/mailgun.ts @@ -395,7 +395,7 @@ Return ONLY the JSON object - no explanations or markdown.`, accessLevel: { type: 'string', description: 'List access level' }, memberAddress: { type: 'string', description: 'Member email address' }, memberName: { type: 'string', description: 'Member name' }, - vars: { type: 'json', description: 'Custom variables JSON' }, + vars: { type: 'string', description: 'Custom variables JSON' }, subscribed: { type: 'string', description: 'Member subscription status' }, }, diff --git a/apps/sim/blocks/blocks/microsoft_excel.ts b/apps/sim/blocks/blocks/microsoft_excel.ts index b63a6c0b63..adb4c5fa17 100644 --- a/apps/sim/blocks/blocks/microsoft_excel.ts +++ b/apps/sim/blocks/blocks/microsoft_excel.ts @@ -304,7 +304,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, range: { type: 'string', description: 'Cell range' }, tableName: { type: 'string', description: 'Table name' }, worksheetName: { type: 'string', description: 'Worksheet name' }, - values: { type: 'json', description: 'Cell values data' }, + values: { type: 'string', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, }, outputs: { @@ -543,7 +543,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, sheetName: { type: 'string', description: 'Name of the sheet/tab' }, manualSheetName: { type: 'string', description: 'Manual sheet name entry' }, cellRange: { type: 'string', description: 'Cell range (e.g., A1:D10)' }, - values: { type: 'json', description: 'Cell values data' }, + values: { type: 'string', description: 'Cell values data' }, valueInputOption: { type: 'string', description: 'Value input option' }, }, outputs: { diff --git a/apps/sim/blocks/blocks/microsoft_planner.ts b/apps/sim/blocks/blocks/microsoft_planner.ts index f9c4f859eb..035832def2 100644 --- a/apps/sim/blocks/blocks/microsoft_planner.ts +++ b/apps/sim/blocks/blocks/microsoft_planner.ts @@ -628,8 +628,8 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, priority: { type: 'number', description: 'Task priority (0-10)' }, percentComplete: { type: 'number', description: 'Task completion percentage (0-100)' }, etag: { type: 'string', description: 'ETag for update/delete operations' }, - checklist: { type: 'json', description: 'Checklist items as JSON' }, - references: { type: 'json', description: 'References as JSON' }, + checklist: { type: 'string', description: 'Checklist items as JSON' }, + references: { type: 'string', description: 'References as JSON' }, previewType: { type: 'string', description: 'Preview type for task details' }, }, outputs: { diff --git a/apps/sim/blocks/blocks/mongodb.ts b/apps/sim/blocks/blocks/mongodb.ts index d527c44f74..0685fee4f7 100644 --- a/apps/sim/blocks/blocks/mongodb.ts +++ b/apps/sim/blocks/blocks/mongodb.ts @@ -898,13 +898,13 @@ Return ONLY the MongoDB query filter as valid JSON - no explanations, no markdow authSource: { type: 'string', description: 'Authentication database' }, ssl: { type: 'string', description: 'SSL mode' }, collection: { type: 'string', description: 'Collection name' }, - query: { type: 'json', description: 'Query filter' }, + query: { type: 'string', description: 'Query filter as JSON string' }, limit: { type: 'number', description: 'Limit number of documents' }, - sort: { type: 'json', description: 'Sort criteria' }, + sort: { type: 'string', description: 'Sort criteria as JSON string' }, documents: { type: 'json', description: 'Documents to insert' }, - filter: { type: 'json', description: 'Filter criteria' }, - update: { type: 'json', description: 'Update operations' }, - pipeline: { type: 'json', description: 'Aggregation pipeline' }, + filter: { type: 'string', description: 'Filter criteria as JSON string' }, + update: { type: 'string', description: 'Update operations as JSON string' }, + pipeline: { type: 'string', description: 'Aggregation pipeline as JSON string' }, upsert: { type: 'boolean', description: 'Create document if not found' }, multi: { type: 'boolean', description: 'Operate on multiple documents' }, }, diff --git a/apps/sim/blocks/blocks/notion.ts b/apps/sim/blocks/blocks/notion.ts index 48193465e6..9bc6e6bf38 100644 --- a/apps/sim/blocks/blocks/notion.ts +++ b/apps/sim/blocks/blocks/notion.ts @@ -369,14 +369,12 @@ export const NotionBlock: BlockConfig = { title: { type: 'string', description: 'Page title' }, // Query database inputs databaseId: { type: 'string', description: 'Database identifier' }, - filter: { type: 'json', description: 'Filter criteria' }, - sorts: { type: 'json', description: 'Sort criteria' }, + filter: { type: 'string', description: 'Filter criteria' }, + sorts: { type: 'string', description: 'Sort criteria' }, pageSize: { type: 'number', description: 'Page size limit' }, // Search inputs query: { type: 'string', description: 'Search query' }, filterType: { type: 'string', description: 'Filter type' }, - // Create/update inputs - properties: { type: 'json', description: 'Page or database properties' }, }, outputs: { // Common outputs across all Notion operations diff --git a/apps/sim/blocks/blocks/posthog.ts b/apps/sim/blocks/blocks/posthog.ts index 743ab38cd7..fc23c70450 100644 --- a/apps/sim/blocks/blocks/posthog.ts +++ b/apps/sim/blocks/blocks/posthog.ts @@ -1291,13 +1291,11 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, // Core Data event: { type: 'string', description: 'Event name' }, distinctId: { type: 'string', description: 'Unique user identifier' }, - properties: { type: 'json', description: 'Event properties as JSON' }, - personProperties: { type: 'json', description: 'Person properties as JSON' }, - groupProperties: { type: 'json', description: 'Group properties as JSON' }, + properties: { type: 'string', description: 'Event properties as JSON' }, timestamp: { type: 'string', description: 'Event timestamp (ISO 8601)' }, - batch: { type: 'json', description: 'Batch events as JSON array' }, + batch: { type: 'string', description: 'Batch events as JSON array' }, query: { type: 'string', description: 'HogQL query or JSON object' }, - values: { type: 'json', description: 'Query parameters' }, + values: { type: 'string', description: 'Query parameters' }, // IDs personId: { type: 'string', description: 'Person ID' }, insightId: { type: 'string', description: 'Insight ID' }, @@ -1315,20 +1313,16 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, name: { type: 'string', description: 'Name' }, description: { type: 'string', description: 'Description' }, key: { type: 'string', description: 'Feature flag key' }, - filters: { type: 'json', description: 'Filters as JSON' }, + filters: { type: 'string', description: 'Filters as JSON' }, active: { type: 'boolean', description: 'Whether flag is active' }, rolloutPercentage: { type: 'number', description: 'Rollout percentage (0-100)' }, - groups: { type: 'json', description: 'Cohort groups as JSON' }, + groups: { type: 'string', description: 'Cohort groups as JSON' }, content: { type: 'string', description: 'Annotation content' }, dateMarker: { type: 'string', description: 'Annotation date' }, scope: { type: 'string', description: 'Annotation scope' }, featureFlagKey: { type: 'string', description: 'Feature flag key for experiment' }, - parameters: { type: 'json', description: 'Experiment parameters as JSON' }, - variants: { type: 'json', description: 'Experiment variants as JSON' }, - questions: { type: 'json', description: 'Survey questions as JSON array' }, - appearance: { type: 'json', description: 'Survey appearance as JSON' }, - conditions: { type: 'json', description: 'Survey conditions as JSON' }, - targetingFlagFilters: { type: 'json', description: 'Targeting flag filters as JSON' }, + parameters: { type: 'string', description: 'Experiment parameters as JSON' }, + questions: { type: 'string', description: 'Survey questions as JSON array' }, surveyType: { type: 'string', description: 'Survey type (popover or api)' }, // List parameters limit: { type: 'number', description: 'Number of results to return' }, diff --git a/apps/sim/blocks/blocks/salesforce.ts b/apps/sim/blocks/blocks/salesforce.ts index e07415186b..e5f077e5f6 100644 --- a/apps/sim/blocks/blocks/salesforce.ts +++ b/apps/sim/blocks/blocks/salesforce.ts @@ -628,7 +628,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n inputs: { operation: { type: 'string', description: 'Operation to perform' }, credential: { type: 'string', description: 'Salesforce credential' }, - filters: { type: 'json', description: 'Report filters' }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, diff --git a/apps/sim/blocks/blocks/sentry.ts b/apps/sim/blocks/blocks/sentry.ts index 1f8796f4cf..558f974b8c 100644 --- a/apps/sim/blocks/blocks/sentry.ts +++ b/apps/sim/blocks/blocks/sentry.ts @@ -663,7 +663,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, ref: { type: 'string', description: 'Git reference' }, url: { type: 'string', description: 'URL' }, dateReleased: { type: 'string', description: 'Release date' }, - commits: { type: 'json', description: 'Commits JSON' }, + commits: { type: 'string', description: 'Commits JSON' }, environment: { type: 'string', description: 'Environment name' }, dateStarted: { type: 'string', description: 'Deploy start time' }, dateFinished: { type: 'string', description: 'Deploy finish time' }, diff --git a/apps/sim/blocks/blocks/sharepoint.ts b/apps/sim/blocks/blocks/sharepoint.ts index 35a17c5b83..5fe1dfb6df 100644 --- a/apps/sim/blocks/blocks/sharepoint.ts +++ b/apps/sim/blocks/blocks/sharepoint.ts @@ -480,7 +480,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, credential: { type: 'string', description: 'Microsoft account credential' }, pageName: { type: 'string', description: 'Page name' }, columnDefinitions: { - type: 'json', + type: 'string', description: 'Column definitions for list creation (JSON array)', }, pageTitle: { type: 'string', description: 'Page title' }, @@ -496,7 +496,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, includeColumns: { type: 'boolean', description: 'Include columns in response' }, includeItems: { type: 'boolean', description: 'Include items in response' }, listItemId: { type: 'string', description: 'List item ID' }, - listItemFields: { type: 'json', description: 'List item fields' }, + listItemFields: { type: 'string', description: 'List item fields' }, driveId: { type: 'string', description: 'Document library (drive) ID' }, folderPath: { type: 'string', description: 'Folder path for file upload' }, fileName: { type: 'string', description: 'File name override' }, diff --git a/apps/sim/blocks/blocks/tinybird.ts b/apps/sim/blocks/blocks/tinybird.ts index 6ca157bdbf..436543de76 100644 --- a/apps/sim/blocks/blocks/tinybird.ts +++ b/apps/sim/blocks/blocks/tinybird.ts @@ -163,7 +163,7 @@ export const TinybirdBlock: BlockConfig = { description: 'Name of the Tinybird Data Source', }, data: { - type: 'json', + type: 'string', description: 'Data to send as JSON or NDJSON string', }, wait: { type: 'boolean', description: 'Wait for database acknowledgment' }, diff --git a/apps/sim/blocks/blocks/zendesk.ts b/apps/sim/blocks/blocks/zendesk.ts index 3ffe78c2d0..687f87819b 100644 --- a/apps/sim/blocks/blocks/zendesk.ts +++ b/apps/sim/blocks/blocks/zendesk.ts @@ -624,10 +624,6 @@ Return ONLY the search query - no explanations.`, email: { type: 'string', description: 'Zendesk email address' }, apiToken: { type: 'string', description: 'Zendesk API token' }, subdomain: { type: 'string', description: 'Zendesk subdomain' }, - customFields: { type: 'json', description: 'Custom fields for ticket' }, - tickets: { type: 'json', description: 'Ticket data' }, - users: { type: 'json', description: 'User data' }, - organizations: { type: 'json', description: 'Organization data' }, }, outputs: { // Ticket operations - list From 1c1b5ae026bc56c850c03772fdc3c510be5dbea2 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 27 Jan 2026 17:57:00 -0800 Subject: [PATCH 6/6] fix param to follow openai new convention --- apps/sim/executor/handlers/agent/agent-handler.ts | 4 ++-- apps/sim/providers/azure-openai/index.ts | 2 +- apps/sim/providers/cerebras/index.ts | 2 +- apps/sim/providers/groq/index.ts | 2 +- apps/sim/providers/openai/index.ts | 2 +- apps/sim/providers/vllm/index.ts | 2 +- apps/sim/providers/xai/index.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/sim/executor/handlers/agent/agent-handler.ts b/apps/sim/executor/handlers/agent/agent-handler.ts index 6c0d19fc37..a22f7a8c4c 100644 --- a/apps/sim/executor/handlers/agent/agent-handler.ts +++ b/apps/sim/executor/handlers/agent/agent-handler.ts @@ -936,8 +936,8 @@ export class AgentBlockHandler implements BlockHandler { systemPrompt: validMessages ? undefined : inputs.systemPrompt, context: validMessages ? undefined : stringifyJSON(messages), tools: formattedTools, - temperature: inputs.temperature, - maxTokens: inputs.maxTokens, + temperature: inputs.temperature != null ? Number(inputs.temperature) : undefined, + maxTokens: inputs.maxTokens != null ? Number(inputs.maxTokens) : undefined, apiKey: inputs.apiKey, azureEndpoint: inputs.azureEndpoint, azureApiVersion: inputs.azureApiVersion, diff --git a/apps/sim/providers/azure-openai/index.ts b/apps/sim/providers/azure-openai/index.ts index 11a5813607..195103ffe0 100644 --- a/apps/sim/providers/azure-openai/index.ts +++ b/apps/sim/providers/azure-openai/index.ts @@ -102,7 +102,7 @@ export const azureOpenAIProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens != null) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_completion_tokens = request.maxTokens if (request.reasoningEffort !== undefined) payload.reasoning_effort = request.reasoningEffort if (request.verbosity !== undefined) payload.verbosity = request.verbosity diff --git a/apps/sim/providers/cerebras/index.ts b/apps/sim/providers/cerebras/index.ts index 4634bee2a0..c185600489 100644 --- a/apps/sim/providers/cerebras/index.ts +++ b/apps/sim/providers/cerebras/index.ts @@ -77,7 +77,7 @@ export const cerebrasProvider: ProviderConfig = { messages: allMessages, } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens != null) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_completion_tokens = request.maxTokens if (request.responseFormat) { payload.response_format = { type: 'json_schema', diff --git a/apps/sim/providers/groq/index.ts b/apps/sim/providers/groq/index.ts index 6f8720c4f6..7be9b7386a 100644 --- a/apps/sim/providers/groq/index.ts +++ b/apps/sim/providers/groq/index.ts @@ -74,7 +74,7 @@ export const groqProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens != null) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_completion_tokens = request.maxTokens if (request.responseFormat) { payload.response_format = { diff --git a/apps/sim/providers/openai/index.ts b/apps/sim/providers/openai/index.ts index 2c46f8e17d..b2cecfceb2 100644 --- a/apps/sim/providers/openai/index.ts +++ b/apps/sim/providers/openai/index.ts @@ -81,7 +81,7 @@ export const openaiProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens != null) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_completion_tokens = request.maxTokens if (request.reasoningEffort !== undefined) payload.reasoning_effort = request.reasoningEffort if (request.verbosity !== undefined) payload.verbosity = request.verbosity diff --git a/apps/sim/providers/vllm/index.ts b/apps/sim/providers/vllm/index.ts index 192f57fbb7..0df5872642 100644 --- a/apps/sim/providers/vllm/index.ts +++ b/apps/sim/providers/vllm/index.ts @@ -135,7 +135,7 @@ export const vllmProvider: ProviderConfig = { } if (request.temperature !== undefined) payload.temperature = request.temperature - if (request.maxTokens != null) payload.max_tokens = request.maxTokens + if (request.maxTokens != null) payload.max_completion_tokens = request.maxTokens if (request.responseFormat) { payload.response_format = { diff --git a/apps/sim/providers/xai/index.ts b/apps/sim/providers/xai/index.ts index e6ba237044..8138265a30 100644 --- a/apps/sim/providers/xai/index.ts +++ b/apps/sim/providers/xai/index.ts @@ -92,7 +92,7 @@ export const xAIProvider: ProviderConfig = { } if (request.temperature !== undefined) basePayload.temperature = request.temperature - if (request.maxTokens != null) basePayload.max_tokens = request.maxTokens + if (request.maxTokens != null) basePayload.max_completion_tokens = request.maxTokens let preparedTools: ReturnType | null = null if (tools?.length) {