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(brevo): add contact and list AI atomics with output schemas (#15502)
Odai Ahmad0c6000f8e4fe
diff --git a/bun.lock b/bun.lockindex a2a316aac04..48a6248d8f3 100644--- a/bun.lock+++ b/bun.lock@@ -8085,7 +8085,7 @@},"packages/pieces/community/sendinblue": {"name": "@activepieces/piece-sendinblue",- "version": "0.4.1",+ "version": "0.4.2","dependencies": {"@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*",diff --git a/packages/pieces/community/sendinblue/package.json b/packages/pieces/community/sendinblue/package.jsonindex 86c13cc77ac..baaf3ac752b 100644--- a/packages/pieces/community/sendinblue/package.json+++ b/packages/pieces/community/sendinblue/package.json@@ -1,6 +1,6 @@{"name": "@activepieces/piece-sendinblue",- "version": "0.4.1",+ "version": "0.4.2","main": "./dist/src/index.js","types": "./dist/src/index.d.ts","scripts": {diff --git a/packages/pieces/community/sendinblue/src/index.ts b/packages/pieces/community/sendinblue/src/index.tsindex 636f443bc3d..85fb89986ce 100644--- a/packages/pieces/community/sendinblue/src/index.ts+++ b/packages/pieces/community/sendinblue/src/index.ts@@ -19,6 +19,7 @@ import { getContactCampaignStats } from './lib/actions/get-contact-campaign-statimport { getContactList } from './lib/actions/get-contact-list';import { getEmailCampaign } from './lib/actions/get-email-campaign';import { getEmailTemplate } from './lib/actions/get-email-template';+import { getImportProcess } from './lib/actions/get-import-process';import { getSmsCampaign } from './lib/actions/get-sms-campaign';import { importContacts } from './lib/actions/import-contacts';import { listCompanies } from './lib/actions/list-companies';@@ -69,6 +70,7 @@ export const sendinblue = createPiece({updateContact,deleteContact,importContacts,+ getImportProcess,listContactAttributes,getContactCampaignStats,createContactList,diff --git a/packages/pieces/community/sendinblue/src/lib/actions/get-import-process.ts b/packages/pieces/community/sendinblue/src/lib/actions/get-import-process.tsnew file mode 100644index 00000000000..c59c18ad789--- /dev/null+++ b/packages/pieces/community/sendinblue/src/lib/actions/get-import-process.ts@@ -0,0 +1,59 @@+import { HttpMethod } from '@activepieces/pieces-common';+import { createAction, Property } from '@activepieces/pieces-framework';+import { sendinblueAuth } from '../auth';+import { brevoCommon } from '../common';+import { getImportProcessActionOutputSchema } from '../output-schemas';++export const getImportProcess = createAction({+ auth: sendinblueAuth,+ name: 'get_import_process',+ outputSchema: getImportProcessActionOutputSchema,+ classification: 'READ',+ displayName: 'Get Import Process',+ description: 'Check the status of a background process such as an import.',+ audience: 'ai',+ aiMetadata: {+ description:+ 'Reads the current status of one Brevo background process by the id that Import Contacts returned. Status is one of queued, in_process, processing, completed, failed or cancelled; a completed import also carries links to CSV files listing invalid emails and duplicate records. This is a single status read, not a wait — call it again after a delay while the status is still queued, in_process or processing. Read-only and idempotent.',+ idempotent: true,+ },+ props: {+ process_id: Property.Number({+ displayName: 'Process ID',+ description: 'The process id returned by Import Contacts.',+ required: true,+ }),+ },+ async run(context) {+ const { process_id } = context.propsValue;++ const process = await brevoCommon.apiCall<ProcessResponse>({+ apiKey: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/processes/${process_id}`,+ });++ return {+ id: process.id ?? process_id,+ status: process.status,+ finished: isTerminalStatus(process.status),+ name: process.name,+ export_url: process.export_url,+ info: process.info,+ };+ },+});++function isTerminalStatus(status: string | undefined): boolean {+ return status !== undefined && TERMINAL_PROCESS_STATUSES.includes(status);+}++const TERMINAL_PROCESS_STATUSES: readonly string[] = ['completed', 'failed', 'cancelled'];++type ProcessResponse = {+ id?: number;+ status?: string;+ name?: string;+ export_url?: string;+ info?: { import?: Record<string, string | null> };+};diff --git a/packages/pieces/community/sendinblue/src/lib/actions/import-contacts.ts b/packages/pieces/community/sendinblue/src/lib/actions/import-contacts.tsindex 8ab68d87ac7..26cbbc72717 100644--- a/packages/pieces/community/sendinblue/src/lib/actions/import-contacts.ts+++ b/packages/pieces/community/sendinblue/src/lib/actions/import-contacts.ts@@ -15,7 +15,7 @@ export const importContacts = createAction({audience: 'ai',aiMetadata: {description:- 'Submits a bulk contact import job to Brevo, from a public file URL or an inline list of email/attribute rows, optionally into an existing or newly created list. This piece has no "get import status" action, so track completion via the Notify URL webhook or the Brevo dashboard. Not idempotent — each call submits a new background import job, even with identical input.',+ 'Submits a bulk contact import job to Brevo, from a public file URL or an inline list of email/attribute rows, optionally into an existing or newly created list. Poll the returned process id with Get Import Process, or track completion via the Notify URL webhook. Not idempotent — each call submits a new background import job, even with identical input.',idempotent: false,},props: {diff --git a/packages/pieces/community/sendinblue/src/lib/output-schemas.ts b/packages/pieces/community/sendinblue/src/lib/output-schemas.tsindex 741c7f01513..33a9f4c1871 100644--- a/packages/pieces/community/sendinblue/src/lib/output-schemas.ts+++ b/packages/pieces/community/sendinblue/src/lib/output-schemas.ts@@ -561,3 +561,48 @@ export const getAccountInfoActionOutputSchema: OutputSchema = {{ key: 'language', label: 'Language' },],};++export const getImportProcessActionOutputSchema: OutputSchema = {+ fields: [+ { key: 'id', label: 'Process ID', format: 'number' },+ {+ key: 'status',+ label: 'Status',+ description: 'queued, in_process, processing, completed, failed or cancelled.',+ },+ {+ key: 'finished',+ label: 'Finished',+ description: 'True once the status is completed, failed or cancelled.',+ format: 'boolean',+ },+ { key: 'name', label: 'Process Name' },+ {+ key: 'export_url',+ label: 'Export URL',+ description: 'Download link, only on completed export processes.',+ format: 'url',+ },+ {+ key: 'info',+ label: 'Details',+ description: 'Only on completed imports.',+ children: [+ {+ key: 'import',+ label: 'Import Report',+ description: 'Links to CSV files of rejected rows, null when there were none.',+ children: [+ { key: 'invalid_emails', label: 'Invalid Emails CSV', format: 'url' },+ { key: 'duplicate_contact_id', label: 'Duplicate Contact IDs CSV', format: 'url' },+ { key: 'duplicate_ext_id', label: 'Duplicate External IDs CSV', format: 'url' },+ { key: 'duplicate_email_id', label: 'Duplicate Emails CSV', format: 'url' },+ { key: 'duplicate_phone_id', label: 'Duplicate Phone Numbers CSV', format: 'url' },+ { key: 'duplicate_whatsapp_id', label: 'Duplicate WhatsApp Numbers CSV', format: 'url' },+ { key: 'duplicate_landline_number_id', label: 'Duplicate Landline Numbers CSV', format: 'url' },+ ],+ },+ ],+ },+ ],+};