AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
feat(airtable): clearer setup forms and working record lookups (#15483)
Talal Jaber74d7dfad200c
diff --git a/bun.lock b/bun.lockindex 100b56c4223..90f93bbf9b9 100644--- a/bun.lock+++ b/bun.lock@@ -435,7 +435,7 @@},"packages/pieces/community/airtable": {"name": "@activepieces/piece-airtable",- "version": "0.8.0",+ "version": "0.9.0","dependencies": {"@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*",diff --git a/docs/install/reference/breaking-changes.mdx b/docs/install/reference/breaking-changes.mdxindex 45d3f11b44b..1170d8bb627 100644--- a/docs/install/reference/breaking-changes.mdx+++ b/docs/install/reference/breaking-changes.mdx@@ -176,6 +176,16 @@ Runs for a project assigned to a worker group used to fall back to the shared quIf you assign projects to worker groups, keep at least one worker online per assigned group. If a group is down, reassign the project to another group or unassign it (set its `workerGroupId` to `null`) — any assignment change moves the project's waiting runs to the new queue.+#### Airtable's Find Record returns up to 1000 matches and the Record picker lists up to 500 records++Find Record used to return only the first page Airtable sent back, 100 records, and silently dropped the rest. It now follows Airtable's paging and returns up to 1000 matching records. The Record dropdown on Get Record by ID listed the first 50 records of a table; it now lists up to 500.++Update Record and Clean Record now send `typecast: true`, as Create Record always has. Airtable then converts text into the field's type instead of rejecting it: a date typed as text is parsed, a select value that does not exist yet is created as a new option, and a linked-record name is resolved to the record. Before, those requests failed with `INVALID_VALUE_FOR_COLUMN`.++#### What you need to do++Nothing to configure or migrate. Check any Update Record or Clean Record step that writes to a single-select or multiple-select field: a value that used to fail because the option did not exist now creates that option in Airtable. Review flows that loop over Find Record's output or count its rows: a search that matched more than 100 records now returns more rows than before, and each extra page is one more request against Airtable's limit of 5 requests per second per base.+## 0.90.4### What has changed?diff --git a/packages/pieces/community/airtable/package.json b/packages/pieces/community/airtable/package.jsonindex 2b25e752a89..62610e359b8 100644--- a/packages/pieces/community/airtable/package.json+++ b/packages/pieces/community/airtable/package.json@@ -1,6 +1,6 @@{"name": "@activepieces/piece-airtable",- "version": "0.8.0",+ "version": "0.9.0","main": "./dist/src/index.js","types": "./dist/src/index.d.ts","dependencies": {diff --git a/packages/pieces/community/airtable/src/i18n/translation.json b/packages/pieces/community/airtable/src/i18n/translation.jsonindex 06b9b6932a9..0fdcaee5bdf 100644--- a/packages/pieces/community/airtable/src/i18n/translation.json+++ b/packages/pieces/community/airtable/src/i18n/translation.json@@ -35,12 +35,12 @@"Update Field (Agent)": "Update Field (Agent)","List Record Comments (Agent)": "List Record Comments (Agent)","Custom API Call": "Custom API Call",- "Adds a record into an airtable": "Adds a record into an airtable",- "Find a record in airtable": "Find a record in airtable",- "Update a record in airtable": "Update a record in airtable",- "Clears fields in a record. Empty values will clear the corresponding fields.": "Clears fields in a record. Empty values will clear the corresponding fields.",- "Deletes a record in airtable": "Deletes a record in airtable",- "Uploads a file to attachment type column.": "Uploads a file to attachment type column.",+ "Adds a new record to a table.": "Adds a new record to a table.",+ "Returns up to 1000 records whose field contains a value.": "Returns up to 1000 records whose field contains a value.",+ "Changes the fields you fill in on an existing record.": "Changes the fields you fill in on an existing record.",+ "Updates a record and empties every field you leave blank.": "Updates a record and empties every field you leave blank.",+ "Deletes a record from a table.": "Deletes a record from a table.",+ "Uploads a file to an attachment field of a record.": "Uploads a file to an attachment field of a record.","Adds a comment to an existing record.": "Adds a comment to an existing record.","Create a new base with a specified table structure.": "Create a new base with a specified table structure.","Create a new table in an existing base.": "Create a new table in an existing base.",@@ -48,7 +48,7 @@"Get a table's details and schema using its ID.": "Get a table's details and schema using its ID.","Retrieve a single record from a table by its unique ID.": "Retrieve a single record from a table by its unique ID.","Find a table in a given base by its name.": "Find a table in a given base by its name.",- "Retrieve the schema for a specific base, including all its tables and fields.": "Retrieve the schema for a specific base, including all its tables and fields.",+ "Lists every table in a base with its fields and views.": "Lists every table in a base with its fields and views.","Adds a record to an Airtable table.": "Adds a record to an Airtable table.","Retrieve a single Airtable record by its ID.": "Retrieve a single Airtable record by its ID.","Update fields on an existing Airtable record by its ID.": "Update fields on an existing Airtable record by its ID.",@@ -70,6 +70,7 @@"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint","Base": "Base","Table": "Table",+ "Fields": "Fields","Search Field": "Search Field","Search Value": "Search Value","View": "View",@@ -78,15 +79,13 @@"File": "File","File Content Type": "File Content Type","File Name": "File Name",- "Comment Text": "Comment Text",+ "Comment": "Comment","Parent Comment ID": "Parent Comment ID","Workspace": "Workspace","Base Name": "Base Name","Tables": "Tables","Table Name": "Table Name","Description": "Description",- "Fields": "Fields",- "Base Name or Keyword": "Base Name or Keyword","Record": "Record","Base ID": "Base ID","Table ID or Name": "Table ID or Name",@@ -102,6 +101,7 @@"Typecast": "Typecast","Record IDs": "Record IDs","Match Mode": "Match Mode",+ "Comment Text": "Comment Text","Workspace ID": "Workspace ID","New Name": "New Name","New Description": "New Description",@@ -116,24 +116,26 @@"Query Parameters": "Query Parameters","Body Type": "Body Type","Body": "Body",- "Response is Binary ?": "Response is Binary ?",- "No Error on Failure": "No Error on Failure",- "Timeout (in seconds)": "Timeout (in seconds)",+ "Response is Binary": "Response is Binary",+ "Return Error as Output": "Return Error as Output",+ "Timeout": "Timeout","Follow redirects": "Follow redirects",- "The ID of the record.": "The ID of the record.",- "The ID of the record to which you want to upload the file.": "The ID of the record to which you want to upload the file.",- "The file to be uploaded, which can be provided either as a public file URL or in Base64 encoded format.": "The file to be uploaded, which can be provided either as a public file URL or in Base64 encoded format.",- "Specifies the MIME type of the file being uploaded (e.g., 'image/png', 'application/pdf').": "Specifies the MIME type of the file being uploaded (e.g., 'image/png', 'application/pdf').",- "The name of the file as it should appear after upload.": "The name of the file as it should appear after upload.",- "The content of the comment. To mention a user, use the format `@[userId]` or `@[userEmail]`.": "The content of the comment. To mention a user, use the format `@[userId]` or `@[userEmail]`.",- "Optional. The ID of a parent comment to create a threaded reply.": "Optional. The ID of a parent comment to create a threaded reply.",- "The name for the new base.": "The name for the new base.",- "Define the tables for the new base. Use the default value as a template. The first field for each table will be its primary field.": "Define the tables for the new base. Use the default value as a template. The first field for each table will be its primary field.",- "The name for the new table.": "The name for the new table.",- "An optional description for the new table.": "An optional description for the new table.",- "A JSON array of fields for the new table. The first field in the array will become the primary field.": "A JSON array of fields for the new table. The first field in the array will become the primary field.",- "The name or keyword to search for within your base names.": "The name or keyword to search for within your base names.",- "The exact name of the table you want to find.": "The exact name of the table you want to find.",+ "Case-sensitive. Records whose field contains this text are returned.": "Case-sensitive. Records whose field contains this text are returned.",+ "Only records in this view are used. Empty: the whole table.": "Only records in this view are used. Empty: the whole table.",+ "Starts with rec. Copy it from the record URL or an earlier step.": "Starts with rec. Copy it from the record URL or an earlier step.",+ "Only attachment-type fields are listed.": "Only attachment-type fields are listed.",+ "A file from an earlier step or a public URL.": "A file from an earlier step or a public URL.",+ "MIME type of the file.": "MIME type of the file.",+ "Name shown in Airtable. Empty: the uploaded file's own name.": "Name shown in Airtable. Empty: the uploaded file's own name.",+ "Mention someone with @[userId] or @[userEmail].": "Mention someone with @[userId] or @[userEmail].",+ "Reply in this comment's thread. Empty: a new top-level comment.": "Reply in this comment's thread. Empty: a new top-level comment.",+ "Listed by ID because Airtable has no workspace name API.": "Listed by ID because Airtable has no workspace name API.",+ "Tables to create. The first field of each table is its primary field.": "Tables to create. The first field of each table is its primary field.",+ "Shown under the table name in Airtable.": "Shown under the table name in Airtable.",+ "Fields for the table. The first one becomes the primary field.": "Fields for the table. The first one becomes the primary field.",+ "Bases whose name contains this text are returned.": "Bases whose name contains this text are returned.",+ "Lists the first 500 records by their primary field.": "Lists the first 500 records by their primary field.",+ "Exact table name. Case does not matter.": "Exact table name. Case does not matter.","The Airtable base ID (e.g. \"appXXXXXXXXXXXXXX\"). Resolve it with List Bases (Agent).": "The Airtable base ID (e.g. \"appXXXXXXXXXXXXXX\"). Resolve it with List Bases (Agent).","The table ID (e.g. \"tblXXXXXXXXXXXXXX\") or its exact name. Resolve it with Get Base Schema (Agent).": "The table ID (e.g. \"tblXXXXXXXXXXXXXX\") or its exact name. Resolve it with Get Base Schema (Agent).","A JSON object mapping field names to values, e.g. {\"Name\": \"Acme\", \"Status\": \"Active\"}. Use Get Base Schema (Agent) to learn field names and types. Linked-record and multi-select fields take arrays of ids/strings; attachment fields take an array of objects like [{\"url\": \"https://...\"}]. Values are sent with typecast enabled so plain strings are coerced where possible.": "A JSON object mapping field names to values, e.g. {\"Name\": \"Acme\", \"Status\": \"Active\"}. Use Get Base Schema (Agent) to learn field names and types. Linked-record and multi-select fields take arrays of ids/strings; attachment fields take an array of objects like [{\"url\": \"https://...\"}]. Values are sent with typecast enabled so plain strings are coerced where possible.",@@ -163,9 +165,11 @@"The record ID (e.g. \"recXXXXXXXXXXXXXX\") to comment on.": "The record ID (e.g. \"recXXXXXXXXXXXXXX\") to comment on.","The comment content. Mention a user with @[userId] or @[userEmail].": "The comment content. Mention a user with @[userId] or @[userEmail].","Optional ID of a parent comment to reply to (creates a threaded reply). Find IDs with List Record Comments (Agent).": "Optional ID of a parent comment to reply to (creates a threaded reply). Find IDs with List Record Comments (Agent).",+ "The name for the new table.": "The name for the new table.","Optional description for the new table.": "Optional description for the new table.","A JSON array of field definitions; the first entry becomes the primary field. Each entry is {\"name\": \"...\", \"type\": \"singleLineText\", \"description\"?: \"...\"}. Select fields need {\"type\": \"singleSelect\", \"options\": {\"choices\": [{\"name\": \"Todo\"}]}}.": "A JSON array of field definitions; the first entry becomes the primary field. Each entry is {\"name\": \"...\", \"type\": \"singleLineText\", \"description\"?: \"...\"}. Select fields need {\"type\": \"singleSelect\", \"options\": {\"choices\": [{\"name\": \"Todo\"}]}}.","The workspace ID (e.g. \"wspXXXXXXXXXXXXXX\") to create the base in. Airtable has no list-workspaces API; get it from a base's metadata or the Airtable UI URL.": "The workspace ID (e.g. \"wspXXXXXXXXXXXXXX\") to create the base in. Airtable has no list-workspaces API; get it from a base's metadata or the Airtable UI URL.",+ "The name for the new base.": "The name for the new base.","A JSON array of tables for the new base. Each table is {\"name\": \"...\", \"fields\": [{\"name\": \"Name\", \"type\": \"singleLineText\"}, ...]}. The first field of each table becomes its primary field.": "A JSON array of tables for the new base. Each table is {\"name\": \"...\", \"fields\": [{\"name\": \"Name\", \"type\": \"singleLineText\"}, ...]}. The first field of each table becomes its primary field.","Optional new name for the table.": "Optional new name for the table.","Optional new description for the table.": "Optional new description for the table.",@@ -181,7 +185,11 @@"Optional number of comments per page (max 100).": "Optional number of comments per page (max 100).","Optional pagination offset returned by a previous call to fetch the next page.": "Optional pagination offset returned by a previous call to fetch the next page.","Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",+ "Appended to the URL as ?key=value.": "Appended to the URL as ?key=value.","Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",+ "On a failed request, output the error instead of failing the step.": "On a failed request, output the error instead of failing the step.",+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Seconds to wait for a response. Empty: up to the flow limit (10 min).",+ "Follow 3xx redirects instead of returning them as the response.": "Follow 3xx redirects instead of returning them as the response.","Contains": "Contains","Exact": "Exact","GET": "GET",@@ -197,7 +205,7 @@"New Record": "New Record","New or Updated Record": "New or Updated Record","Triggers when a new record is added to the selected table.": "Triggers when a new record is added to the selected table.",- "Triggers when a record is created or updated in selected table.": "Triggers when a record is created or updated in selected table.",- "Trigger field": "Trigger field",- "**Last Modified Time** field will be used to watch new or updated records.Please create **Last Modified Time** field in your schema,if you don't have any timestamp field.": "**Last Modified Time** field will be used to watch new or updated records.Please create **Last Modified Time** field in your schema,if you don't have any timestamp field."+ "Triggers when a record is created or changed in the selected table.": "Triggers when a record is created or changed in the selected table.",+ "Trigger Field": "Trigger Field",+ "A Last Modified Time field of the table. Add one if none exists.": "A Last Modified Time field of the table. Add one if none exists."}\ No newline at end of filediff --git a/packages/pieces/community/airtable/src/index.ts b/packages/pieces/community/airtable/src/index.tsindex 0faa000213c..636c63bf6ff 100644--- a/packages/pieces/community/airtable/src/index.ts+++ b/packages/pieces/community/airtable/src/index.ts@@ -44,7 +44,7 @@ export const airtable = createPiece({displayName: 'Airtable',description: 'Low‒code platform to build apps.',- minimumSupportedRelease: '0.86.4',+ minimumSupportedRelease: '0.88.2',logoUrl: 'https://cdn.activepieces.com/pieces/airtable.png',authors: ['kanarelo',diff --git a/packages/pieces/community/airtable/src/lib/actions/add-comment-to-record.ts b/packages/pieces/community/airtable/src/lib/actions/add-comment-to-record.tsindex 1158063419d..343e7d455e0 100644--- a/packages/pieces/community/airtable/src/lib/actions/add-comment-to-record.ts+++ b/packages/pieces/community/airtable/src/lib/actions/add-comment-to-record.ts@@ -21,16 +21,17 @@ export const airtableAddCommentToRecordAction = createAction({tableId: airtableCommon.tableId,recordId: airtableCommon.recordId,text: Property.LongText({- displayName: 'Comment Text',- description:- 'The content of the comment. To mention a user, use the format `@[userId]` or `@[userEmail]`.',+ displayName: 'Comment',+ description: 'Mention someone with @[userId] or @[userEmail].',required: true,}),parentCommentId: Property.ShortText({displayName: 'Parent Comment ID',description:- 'Optional. The ID of a parent comment to create a threaded reply.',+ "Reply in this comment's thread. Empty: a new top-level comment.",+ placeholder: 'comXXXXXXXXXXXXXX',required: false,+ advanced: true,}),},async run(context) {diff --git a/packages/pieces/community/airtable/src/lib/actions/clean-record.ts b/packages/pieces/community/airtable/src/lib/actions/clean-record.tsindex 89d567e55bc..bb1f48d4078 100644--- a/packages/pieces/community/airtable/src/lib/actions/clean-record.ts+++ b/packages/pieces/community/airtable/src/lib/actions/clean-record.ts@@ -11,8 +11,7 @@ export const airtableCleanRecordAction = createAction({name: 'airtable_clean_record',classification: 'DESTRUCTIVE',displayName: 'Clean Record',- description:- 'Clears fields in a record. Empty values will clear the corresponding fields.',+ description: 'Updates a record and empties every field you leave blank.',audience: 'both',outputSchema: cleanRecordActionOutputSchema,aiMetadata: {@@ -45,6 +44,7 @@ export const airtableCleanRecordAction = createAction({tableId: tableId as string,recordId: recordId as string,fields: updatedFields as Record<string, unknown>,+ typecast: true,});},});diff --git a/packages/pieces/community/airtable/src/lib/actions/create-base.ts b/packages/pieces/community/airtable/src/lib/actions/create-base.tsindex 8387a1c04c5..b5540e9288e 100644--- a/packages/pieces/community/airtable/src/lib/actions/create-base.ts+++ b/packages/pieces/community/airtable/src/lib/actions/create-base.ts@@ -21,13 +21,12 @@ export const airtableCreateBaseAction = createAction({workspaceId: airtableCommon.workspaceId,name: Property.ShortText({displayName: 'Base Name',- description: 'The name for the new base.',required: true,}),tables: Property.Json({displayName: 'Tables',description:- 'Define the tables for the new base. Use the default value as a template. The first field for each table will be its primary field.',+ 'Tables to create. The first field of each table is its primary field.',required: true,defaultValue: [{diff --git a/packages/pieces/community/airtable/src/lib/actions/create-record.ts b/packages/pieces/community/airtable/src/lib/actions/create-record.tsindex 415d218347d..93adae64728 100644--- a/packages/pieces/community/airtable/src/lib/actions/create-record.ts+++ b/packages/pieces/community/airtable/src/lib/actions/create-record.ts@@ -11,7 +11,7 @@ export const airtableCreateRecordAction = createAction({name: 'airtable_create_record',classification: 'WRITE',displayName: 'Create Airtable Record',- description: 'Adds a record into an airtable',+ description: 'Adds a new record to a table.',audience: 'human',outputSchema: createRecordActionOutputSchema,aiMetadata: {diff --git a/packages/pieces/community/airtable/src/lib/actions/create-table.ts b/packages/pieces/community/airtable/src/lib/actions/create-table.tsindex 4f78f51c007..76928c1c4ff 100644--- a/packages/pieces/community/airtable/src/lib/actions/create-table.ts+++ b/packages/pieces/community/airtable/src/lib/actions/create-table.ts@@ -21,18 +21,18 @@ export const airtableCreateTableAction = createAction({base: airtableCommon.base,name: Property.ShortText({displayName: 'Table Name',- description: 'The name for the new table.',required: true,}),description: Property.LongText({displayName: 'Description',- description: 'An optional description for the new table.',+ description: 'Shown under the table name in Airtable.',required: false,+ advanced: true,}),fields: Property.Json({displayName: 'Fields',description:- 'A JSON array of fields for the new table. The first field in the array will become the primary field.',+ 'Fields for the table. The first one becomes the primary field.',required: true,defaultValue: [{diff --git a/packages/pieces/community/airtable/src/lib/actions/delete-record.ts b/packages/pieces/community/airtable/src/lib/actions/delete-record.tsindex b6bf5ba1867..4000ffbc402 100644--- a/packages/pieces/community/airtable/src/lib/actions/delete-record.ts+++ b/packages/pieces/community/airtable/src/lib/actions/delete-record.ts@@ -8,7 +8,7 @@ export const airtableDeleteRecordAction = createAction({name: 'airtable_delete_record',classification: 'DESTRUCTIVE',displayName: 'Delete Airtable Record',- description: 'Deletes a record in airtable',+ description: 'Deletes a record from a table.',audience: 'human',outputSchema: deleteRecordActionOutputSchema,aiMetadata: {diff --git a/packages/pieces/community/airtable/src/lib/actions/find-base.ts b/packages/pieces/community/airtable/src/lib/actions/find-base.tsindex 6509e1e810e..20a3ee390ba 100644--- a/packages/pieces/community/airtable/src/lib/actions/find-base.ts+++ b/packages/pieces/community/airtable/src/lib/actions/find-base.ts@@ -19,8 +19,9 @@ export const airtableFindBaseAction = createAction({},props: {baseName: Property.ShortText({- displayName: 'Base Name or Keyword',- description: 'The name or keyword to search for within your base names.',+ displayName: 'Base Name',+ description: 'Bases whose name contains this text are returned.',+ placeholder: 'e.g. CRM',required: true,}),},diff --git a/packages/pieces/community/airtable/src/lib/actions/find-record.ts b/packages/pieces/community/airtable/src/lib/actions/find-record.tsindex 9fce43e9643..ea5c13ebfc4 100644--- a/packages/pieces/community/airtable/src/lib/actions/find-record.ts+++ b/packages/pieces/community/airtable/src/lib/actions/find-record.ts@@ -9,7 +9,7 @@ export const airtableFindRecordAction = createAction({name: 'airtable_find_record',classification: 'SEARCH',displayName: 'Find Airtable Record',- description: 'Find a record in airtable',+ description: 'Returns up to 1000 records whose field contains a value.',audience: 'human',outputSchema: findRecordActionOutputSchema,aiMetadata: {@@ -24,6 +24,8 @@ export const airtableFindRecordAction = createAction({searchValue: Property.ShortText({displayName: 'Search Value',required: true,+ description: 'Case-sensitive. Records whose field contains this text are returned.',+ placeholder: 'e.g. [email protected]',}),limitToView: airtableCommon.views,},diff --git a/packages/pieces/community/airtable/src/lib/actions/find-table.ts b/packages/pieces/community/airtable/src/lib/actions/find-table.tsindex 33366e74cfd..50e42e8342e 100644--- a/packages/pieces/community/airtable/src/lib/actions/find-table.ts+++ b/packages/pieces/community/airtable/src/lib/actions/find-table.ts@@ -21,7 +21,8 @@ export const airtableFindTableAction = createAction({base: airtableCommon.base,tableName: Property.ShortText({displayName: 'Table Name',- description: 'The exact name of the table you want to find.',+ description: 'Exact table name. Case does not matter.',+ placeholder: 'e.g. Contacts',required: true,}),},diff --git a/packages/pieces/community/airtable/src/lib/actions/get-base-schema.ts b/packages/pieces/community/airtable/src/lib/actions/get-base-schema.tsindex 16c58f2c8fb..036dc72f4b0 100644--- a/packages/pieces/community/airtable/src/lib/actions/get-base-schema.ts+++ b/packages/pieces/community/airtable/src/lib/actions/get-base-schema.ts@@ -8,8 +8,7 @@ export const airtableGetBaseSchemaAction = createAction({name: 'airtable_get_base_schema',classification: 'READ',displayName: 'Get Base Schema',- description:- 'Retrieve the schema for a specific base, including all its tables and fields.',+ description: 'Lists every table in a base with its fields and views.',audience: 'human',outputSchema: getBaseSchemaActionOutputSchema,aiMetadata: {diff --git a/packages/pieces/community/airtable/src/lib/actions/update-record.ts b/packages/pieces/community/airtable/src/lib/actions/update-record.tsindex 252ac6854b7..16a7330f619 100644--- a/packages/pieces/community/airtable/src/lib/actions/update-record.ts+++ b/packages/pieces/community/airtable/src/lib/actions/update-record.ts@@ -12,7 +12,7 @@ export const airtableUpdateRecordAction = createAction({name: 'airtable_update_record',classification: 'WRITE',displayName: 'Update Airtable Record',- description: 'Update a record in airtable',+ description: 'Changes the fields you fill in on an existing record.',audience: 'human',outputSchema: updateRecordActionOutputSchema,aiMetadata: {@@ -56,6 +56,7 @@ export const airtableUpdateRecordAction = createAction({tableId: tableId as string,recordId: recordId as string,fields: updatedFields as Record<string, unknown>,+ typecast: true,});},});diff --git a/packages/pieces/community/airtable/src/lib/actions/upload-file-to-column.ts b/packages/pieces/community/airtable/src/lib/actions/upload-file-to-column.tsindex c8e8e159280..63dc1b18e3e 100644--- a/packages/pieces/community/airtable/src/lib/actions/upload-file-to-column.ts+++ b/packages/pieces/community/airtable/src/lib/actions/upload-file-to-column.ts@@ -15,7 +15,7 @@ export const airtableUploadFileToColumnAction = createAction({name: 'airtable_upload_file_to_column',classification: 'WRITE',displayName: 'Upload File to Column',- description: 'Uploads a file to attachment type column.',+ description: 'Uploads a file to an attachment field of a record.',audience: 'human',outputSchema: uploadFileToColumnActionOutputSchema,aiMetadata: {@@ -26,60 +26,84 @@ export const airtableUploadFileToColumnAction = createAction({props: {base: airtableCommon.base,tableId: airtableCommon.tableId,- attachment_column: Property.Dropdown({+ attachment_column: Property.Dropdown<string, true, typeof airtableAuth>({auth: airtableAuth,displayName: 'Attachment Column',+ description: 'Only attachment-type fields are listed.',required: true,refreshers: ['base', 'tableId'],options: async ({ auth, base, tableId }) => {- if (!auth || !base || !tableId) {+ if (!auth) {return {- placeholder: 'Please select a base and table first',+ disabled: true,options: [],+ placeholder: 'Connect your Airtable account first',+ };+ }+ if (!base) {+ return {disabled: true,+ options: [],+ placeholder: 'Select a base first',+ };+ }+ if (!tableId) {+ return {+ disabled: true,+ options: [],+ placeholder: 'Select a table first',};}- const airtable: AirtableTable = await airtableCommon.fetchTable({- token: auth as unknown as string,- baseId: base as unknown as string,- tableId: tableId as unknown as string,- });-- return {- disabled: false,+ try {+ const airtable: AirtableTable = await airtableCommon.fetchTable({+ token: auth.secret_text,+ baseId: base as string,+ tableId: tableId as string,+ });- options: airtable.fields- .filter((field) => field.type === 'multipleAttachments')- .map((field) => {- return {+ return {+ disabled: false,+ options: airtable.fields+ .filter((field) => field.type === 'multipleAttachments')+ .map((field) => ({label: field.name,value: field.id,- };- }),- };+ })),+ };+ } catch (e) {+ console.debug(e);+ return {+ disabled: true,+ options: [],+ placeholder: `Could not load. Check the token's scopes.`,+ };+ }},}),recordId: Property.ShortText({displayName: 'Record ID',required: true,- description: 'The ID of the record to which you want to upload the file.',+ description:+ 'Starts with rec. Copy it from the record URL or an earlier step.',+ placeholder: 'recXXXXXXXXXXXXXX',}),file: Property.File({displayName: 'File',required: true,- description:- 'The file to be uploaded, which can be provided either as a public file URL or in Base64 encoded format.',+ description: 'A file from an earlier step or a public URL.',}),file_content_type: Property.ShortText({displayName: 'File Content Type',required: true,- description: `Specifies the MIME type of the file being uploaded (e.g., 'image/png', 'application/pdf').`,+ description: 'MIME type of the file.',+ placeholder: 'image/png',}),filename: Property.ShortText({displayName: 'File Name',- description: 'The name of the file as it should appear after upload.',+ description: `Name shown in Airtable. Empty: the uploaded file's own name.`,required: false,+ advanced: true,}),},async run(context) {diff --git a/packages/pieces/community/airtable/src/lib/common/index.ts b/packages/pieces/community/airtable/src/lib/common/index.tsindex 31245ad888f..6aa6849f244 100644--- a/packages/pieces/community/airtable/src/lib/common/index.ts+++ b/packages/pieces/community/airtable/src/lib/common/index.ts@@ -2,6 +2,7 @@ import {AuthenticationType,HttpMethod,HttpRequest,+ HttpResponse,httpClient,} from '@activepieces/pieces-common';import {@@ -26,6 +27,37 @@ import {import { isNil } from '@activepieces/pieces-framework';import { airtableAuth } from '../auth';+const MAX_FIND_RECORDS = 1000;+const RATE_LIMIT_STATUS = 429;+const RATE_LIMIT_PAUSE_MS = 30000;+const RATE_LIMIT_RETRIES = 2;+const DROPDOWN_RATE_LIMIT_RETRIES = 0;++function isRateLimited(error: unknown): boolean {+ return (+ (error as { response?: { status?: number } })?.response?.status ===+ RATE_LIMIT_STATUS+ );+}++async function sendPage<T>(+ request: HttpRequest,+ rateLimitRetries: number+): Promise<HttpResponse<T>> {+ for (let attempt = 0; ; attempt++) {+ if (attempt > 0) {+ await new Promise((resolve) => setTimeout(resolve, RATE_LIMIT_PAUSE_MS));+ }+ try {+ return await httpClient.sendRequest<T>(request);+ } catch (error) {+ if (!isRateLimited(error) || attempt >= rateLimitRetries) {+ throw error;+ }+ }+ }+}+interface Params {personalToken: string;@@ -43,6 +75,7 @@ interface Params {workspaceId?: string;name?: string;tables?: AirtableTableConfig[];+ typecast?: boolean;}async function fetchAllBases({@@ -102,28 +135,42 @@ async function listRecords({token,baseId,tableId,- pageSize = 50,+ pageSize = 100,+ maxRecords = 500,}: {token: string;baseId: string;tableId: string;pageSize?: number;+ maxRecords?: number;}): Promise<AirtableRecord[]> {- const response = await httpClient.sendRequest<{ records: AirtableRecord[] }>({- method: HttpMethod.GET,- url: `https://api.airtable.com/v0/${baseId}/${tableId}`,- authentication: {- type: AuthenticationType.BEARER_TOKEN,- token,- },- queryParams: {- pageSize: pageSize.toString(),- },- });- if (response.status === 200) {- return response.body.records;- }- return [];+ const allRecords: AirtableRecord[] = [];+ let offset: string | undefined = undefined;++ do {+ const request: HttpRequest = {+ method: HttpMethod.GET,+ url: `https://api.airtable.com/v0/${baseId}/${tableId}`,+ authentication: {+ type: AuthenticationType.BEARER_TOKEN,+ token,+ },+ queryParams: {+ pageSize: pageSize.toString(),+ ...(offset ? { offset } : {}),+ },+ retries: 3,+ };+ const response = await sendPage<{+ records: AirtableRecord[];+ offset?: string;+ }>(request, DROPDOWN_RATE_LIMIT_RETRIES);++ allRecords.push(...response.body.records);+ offset = response.body.offset;+ } while (offset && allRecords.length < maxRecords);++ return allRecords.slice(0, maxRecords);}async function fetchTableList({@@ -214,28 +261,44 @@ async function findRecord({baseId,limitToView,}: Params) {- const request: HttpRequest = {- method: HttpMethod.GET,- url: `https://api.airtable.com/v0/${baseId}/${tableId}`,- authentication: {- type: AuthenticationType.BEARER_TOKEN,- token,- },- queryParams: {- filterByFormula: `FIND("${searchValue}",{${searchField}})`,- view: limitToView ?? '',- },- };+ const escapedSearchValue = (searchValue ?? '')+ .replace(/\\/g, '\\\\')+ .replace(/"/g, '\\"');+ if (/[{}]/.test(searchField ?? '')) {+ throw new Error(+ 'Search Field must not contain "{" or "}" because Airtable cannot escape braces inside a field reference.'+ );+ }+ const allRecords: AirtableRecord[] = [];+ let offset: string | undefined = undefined;- const response = await httpClient.sendRequest<{- records: AirtableRecord[];- }>(request);+ do {+ const request: HttpRequest = {+ method: HttpMethod.GET,+ url: `https://api.airtable.com/v0/${baseId}/${tableId}`,+ authentication: {+ type: AuthenticationType.BEARER_TOKEN,+ token,+ },+ queryParams: {+ filterByFormula: `FIND("${escapedSearchValue}",{${searchField}})`,+ pageSize: '100',+ ...(limitToView ? { view: limitToView } : {}),+ ...(offset ? { offset } : {}),+ },+ retries: 3,+ };- if (response.status === 200) {- return response.body.records;- }+ const response = await sendPage<{+ records: AirtableRecord[];+ offset?: string;+ }>(request, RATE_LIMIT_RETRIES);- return [];+ allRecords.push(...response.body.records);+ offset = response.body.offset;+ } while (offset && allRecords.length < MAX_FIND_RECORDS);++ return allRecords.slice(0, MAX_FIND_RECORDS);}async function updateRecord({personalToken: token,@@ -243,6 +306,7 @@ async function updateRecord({recordId,tableId,baseId,+ typecast,}: Params) {const request: HttpRequest = {method: HttpMethod.PATCH,@@ -253,6 +317,7 @@ async function updateRecord({},body: {fields,+ ...(typecast ? { typecast: true } : {}),},};@@ -432,7 +497,7 @@ export const airtableCommon = {return {disabled: true,options: [],- placeholder: 'Please connect your account',+ placeholder: 'Connect your Airtable account first',};}@@ -451,7 +516,7 @@ export const airtableCommon = {return {disabled: true,options: [],- placeholder: 'Please check your permission scope',+ placeholder: "Could not load. Check the token's scopes.",};}},@@ -460,6 +525,8 @@ export const airtableCommon = {workspaceId: Property.Dropdown<string,true,typeof airtableAuth>({auth: airtableAuth,displayName: 'Workspace',+ description:+ 'Listed by ID because Airtable has no workspace name API.',required: true,refreshers: [],options: async ({ auth }) => {@@ -467,35 +534,42 @@ export const airtableCommon = {return {disabled: true,options: [],- placeholder: 'Please connect your account',+ placeholder: 'Connect your Airtable account first',};}- // Although there is no direct way to get a list of workspaces,- // we can get a list of bases and then fetch each base to get the workspace id.- const bases = await fetchAllBases({- token: auth.secret_text,- });- const workspacePromises = bases.map((base) =>- fetchBase({ token: auth.secret_text, baseId: base.id })- );- const basesWithWorkspaces = await Promise.all(workspacePromises);+ try {+ const bases = await fetchAllBases({+ token: auth.secret_text,+ });- const workspaces = basesWithWorkspaces.reduce((acc, base) => {- if (base.workspaceId) {- // Since we don't have the workspace name, we will use the ID as the name.- acc[base.workspaceId] = base.workspaceId;- }- return acc;- }, {} as Record<string, string>);-- return {- disabled: false,- options: Object.entries(workspaces).map(([id, name]) => ({- label: name,- value: id,- })),- };+ const workspacePromises = bases.map((base) =>+ fetchBase({ token: auth.secret_text, baseId: base.id })+ );+ const basesWithWorkspaces = await Promise.all(workspacePromises);++ const workspaces = basesWithWorkspaces.reduce((acc, base) => {+ if (base.workspaceId) {+ acc[base.workspaceId] = base.workspaceId;+ }+ return acc;+ }, {} as Record<string, string>);++ return {+ disabled: false,+ options: Object.entries(workspaces).map(([id, name]) => ({+ label: name,+ value: id,+ })),+ };+ } catch (e) {+ console.debug(e);+ return {+ disabled: true,+ options: [],+ placeholder: "Could not load. Check the token's scopes.",+ };+ }},}),@@ -509,14 +583,14 @@ export const airtableCommon = {return {disabled: true,options: [],- placeholder: 'Please connect your account',+ placeholder: 'Connect your Airtable account first',};}if (!base) {return {disabled: true,options: [],- placeholder: 'Please select a base first',+ placeholder: 'Select a base first',};}@@ -538,7 +612,7 @@ export const airtableCommon = {return {disabled: true,options: [],- placeholder: 'Please check your permission scope',+ placeholder: "Could not load. Check the token's scopes.",};}},@@ -547,6 +621,7 @@ export const airtableCommon = {views: Property.Dropdown<string,false,typeof airtableAuth>({auth: airtableAuth,displayName: 'View',+ description: 'Only records in this view are used. Empty: the whole table.',required: false,refreshers: ['base', 'tableId'],options: async ({ auth, base, tableId }): Promise<DropdownState<string>> => {@@ -554,49 +629,60 @@ export const airtableCommon = {return {disabled: true,options: [],- placeholder: 'Please connect your account',+ placeholder: 'Connect your Airtable account first',};}if (!base) {return {disabled: true,options: [],- placeholder: 'Please select a base first',+ placeholder: 'Select a base first',};}if (!tableId) {return {disabled: true,options: [],- placeholder: 'Please select a table first',+ placeholder: 'Select a table first',};}- const views: AirtableView[] = await fetchViews({- token: auth.secret_text,- baseId: base as string,- tableId: tableId as string,- });+ try {+ const views: AirtableView[] = await fetchViews({+ token: auth.secret_text,+ baseId: base as string,+ tableId: tableId as string,+ });- return {- disabled: false,- options: views.map((view) => ({- value: view.id,- label: view.name,- })),- };+ return {+ disabled: false,+ options: views.map((view) => ({+ value: view.id,+ label: view.name,+ })),+ };+ } catch (e) {+ console.debug(e);+ return {+ disabled: true,+ options: [],+ placeholder: "Could not load. Check the token's scopes.",+ };+ }},}),recordId: Property.ShortText({displayName: 'Record ID',required: true,- description: 'The ID of the record.',+ description:+ 'Starts with rec. Copy it from the record URL or an earlier step.',+ placeholder: 'recXXXXXXXXXXXXXX',}),fields: Property.DynamicProperties({auth: airtableAuth,- displayName: 'Table',+ displayName: 'Fields',required: true,refreshers: ['base', 'tableId'],@@ -614,12 +700,14 @@ export const airtableCommon = {if (!AirtableEnterpriseFields.includes(field.type)) {const params = {displayName: field.name,- description: ['date', 'dateTime'].includes(field.type)- ? `${- field.description ? field.description : ''- }Expected format: mmmm d,yyyy`- : field.description,+ description: field.description,required: false,+ ...(field.type === 'date'+ ? { placeholder: '2024-03-05' }+ : {}),+ ...(field.type === 'dateTime'+ ? { placeholder: '2024-03-05T10:30:00Z' }+ : {}),};if (isNil(AirtableFieldMapping[field.type])) {@@ -658,51 +746,73 @@ export const airtableCommon = {recordIdDropdown: Property.Dropdown<string,true,typeof airtableAuth>({auth: airtableAuth,displayName: 'Record',+ description:+ 'Lists the first 500 records by their primary field.',required: true,refreshers: ['base', 'tableId'],options: async ({ auth, base, tableId }) => {- if (!auth || !base || !tableId) {+ if (!auth) {return {disabled: true,options: [],- placeholder: 'Please select a base and table first',+ placeholder: 'Connect your Airtable account first',+ };+ }+ if (!base) {+ return {+ disabled: true,+ options: [],+ placeholder: 'Select a base first',+ };+ }+ if (!tableId) {+ return {+ disabled: true,+ options: [],+ placeholder: 'Select a table first',};}+ try {+ const table = await fetchTable({+ token: auth.secret_text,+ baseId: base as string,+ tableId: tableId as string,+ });+ const primaryField = table.fields.find(+ (f) => f.id === table.primaryFieldId+ );+ const primaryFieldName = primaryField?.name;++ const records = await listRecords({+ token: auth.secret_text,+ baseId: base as string,+ tableId: tableId as string,+ });++ const options = records.map((record) => {+ let label = record.id;+ if (primaryFieldName && record.fields[primaryFieldName]) {+ label = record.fields[primaryFieldName] as string;+ }+ return {+ label: label,+ value: record.id,+ };+ });- const table = await fetchTable({- token: auth.secret_text,- baseId: base as string,- tableId: tableId as string,- });- const primaryField = table.fields.find(- (f) => f.id === table.primaryFieldId- );- const primaryFieldName = primaryField?.name;--- const records = await listRecords({- token: auth.secret_text,- baseId: base as string,- tableId: tableId as string,- });--- const options = records.map((record) => {- let label = record.id;- if (primaryFieldName && record.fields[primaryFieldName]) {- label = record.fields[primaryFieldName] as string;- }return {- label: label,- value: record.id,+ disabled: false,+ options: options,};- });-- return {- disabled: false,- options: options,- };+ } catch (e) {+ console.debug(e);+ return {+ disabled: true,+ options: [],+ placeholder: "Could not load. Check the token's scopes.",+ };+ }},}),@@ -716,35 +826,45 @@ export const airtableCommon = {return {disabled: true,options: [],- placeholder: 'Please connect your account',+ placeholder: 'Connect your Airtable account first',};}if (!base) {return {disabled: true,options: [],- placeholder: 'Please select a base first',+ placeholder: 'Select a base first',};}if (!tableId) {return {disabled: true,options: [],- placeholder: 'Please select a table first',+ placeholder: 'Select a table first',+ };+ }++ try {+ const airtable: AirtableTable = await fetchTable({+ token: auth.secret_text,+ baseId: base as string,+ tableId: tableId as string,+ });+ return {+ disabled: false,+ options: airtable.fields.map((field: AirtableField) => ({+ label: field.name,+ value: field.name,+ })),+ };+ } catch (e) {+ console.debug(e);+ return {+ disabled: true,+ options: [],+ placeholder: "Could not load. Check the token's scopes.",};}- const airtable: AirtableTable = await fetchTable({- token: auth.secret_text,- baseId: base as string,- tableId: tableId as string,- });- return {- disabled: false,- options: airtable.fields.map((field: AirtableField) => ({- label: field.name,- value: field.name,- })),- };},}),diff --git a/packages/pieces/community/airtable/src/lib/trigger/update-record.trigger.ts b/packages/pieces/community/airtable/src/lib/trigger/update-record.trigger.tsindex 4d3180756aa..9db93fb9eb7 100644--- a/packages/pieces/community/airtable/src/lib/trigger/update-record.trigger.ts+++ b/packages/pieces/community/airtable/src/lib/trigger/update-record.trigger.ts@@ -5,6 +5,7 @@ import {} from '@activepieces/pieces-common';import {AppConnectionValueForAuthProperty,+ DropdownState,Property,StaticPropsValue,TriggerStrategy,@@ -20,49 +21,70 @@ import { updatedRecordTriggerOutputSchema } from '../output-schemas';const props = {base: airtableCommon.base,tableId: airtableCommon.tableId,- sortFields: Property.Dropdown({+ sortFields: Property.Dropdown<string, true, typeof airtableAuth>({auth: airtableAuth,- displayName: 'Trigger field',- description: `**Last Modified Time** field will be used to watch new or updated records.Please create **Last Modified Time** field in your schema,if you don't have any timestamp field.`,+ displayName: 'Trigger Field',+ description:+ 'A Last Modified Time field of the table. Add one if none exists.',required: true,refreshers: ['base', 'tableId'],- options: async ({ auth, base, tableId }) => {+ options: async ({ auth, base, tableId }): Promise<DropdownState<string>> => {if (!auth) {return {disabled: true,options: [],- placeholder: 'Please connect your account',+ placeholder: 'Connect your Airtable account first',};}if (!base) {return {disabled: true,options: [],- placeholder: 'Please select a base first',+ placeholder: 'Select a base first',};}if (!tableId) {return {disabled: true,options: [],- placeholder: 'Please select a table first',+ placeholder: 'Select a table first',};}- const airtable: AirtableTable = await airtableCommon.fetchTable({- token: auth as unknown as string,- baseId: base as unknown as string,- tableId: tableId as unknown as string,- });- return {- disabled: false,- options: airtable.fields- .filter((field: AirtableField) => field.type == 'lastModifiedTime')+ try {+ const airtable: AirtableTable = await airtableCommon.fetchTable({+ token: auth.secret_text,+ baseId: base as string,+ tableId: tableId as string,+ });++ const options = airtable.fields+ .filter((field: AirtableField) => field.type === 'lastModifiedTime').map((field: AirtableField) => ({label: field.name,value: field.name,- })),- };+ }));++ if (options.length === 0) {+ return {+ disabled: true,+ options: [],+ placeholder: 'This table has no Last Modified Time field',+ };+ }++ return {+ disabled: false,+ options,+ };+ } catch (e) {+ console.debug(e);+ return {+ disabled: true,+ options: [],+ placeholder: "Could not load. Check the token's scopes.",+ };+ }},}),viewId: airtableCommon.views,@@ -87,7 +109,7 @@ const polling: Polling<AppConnectionValueForAuthProperty<typeof airtableAuth>, SfilterByFormula: `IS_AFTER({${propsValue.sortFields as string}},DATETIME_PARSE("${lastUpdateDate}","YYYY-MM-DD HH:mm:ss.SSS"))`,- view: propsValue.viewId ?? '',+ ...(propsValue.viewId ? { view: propsValue.viewId } : {}),}).all();@@ -108,7 +130,7 @@ export const airtableUpdatedRecordTrigger = createTrigger({classification: 'READ',displayName: 'New or Updated Record',description:- 'Triggers when a record is created or updated in selected table.',+ 'Triggers when a record is created or changed in the selected table.',outputSchema: updatedRecordTriggerOutputSchema,aiMetadata: {description: