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
import { createAction, Property } from '@activepieces/pieces-framework';
import {
dataforb2bAuth,
dataForB2BRequest,
buildConditions,
buildFiltersProp,
filterLogicProp,
finalizeFilters,
advancedFiltersProp,
peopleFilterFields,
RawFilter,
} from '../common';
export const searchPeople = createAction({
auth: dataforb2bAuth,
name: 'search_people',
displayName: 'Search People',
description: 'Find professionals using 50+ filters (title, company, LinkedIn URL, skills, location, education, funding...).',
audience: 'both',
aiMetadata: {
description: 'Search the DataForB2B people database with structured filter conditions across 50+ profile fields (current and past title, company, skills, location, education, languages, certifications, experience), combined by AND or OR and optionally merged with a raw advanced-filter JSON group. Use to build prospect or candidate lists by criteria, then pass a returned identifier to Enrich Profile for email and phone; prefer Reasoning Search when the criteria are only expressible in plain language. Requires at least one filter or an advanced filter group; read-only and idempotent.',
idempotent: true,
},
props: {
match: filterLogicProp,
filters: buildFiltersProp(peopleFilterFields, 'current_title'),
advancedFilters: advancedFiltersProp,
count: Property.Number({
displayName: 'Count',
description: 'Number of results to return (max 1000)',
required: false,
defaultValue: 25,
}),
offset: Property.Number({
displayName: 'Offset',
description: 'Pagination offset - number of results to skip',
required: false,
defaultValue: 0,
}),
enrichLive: Property.Checkbox({
displayName: 'Enrich Live',
description: 'Enrich results with fresh live data',
required: false,
defaultValue: false,
}),
},
async run(context) {
const { match, filters, advancedFilters, count, offset, enrichLive } =
context.propsValue;
const conditions = buildConditions((filters ?? []) as RawFilter[]);
const finalFilters = finalizeFilters(conditions, match ?? 'and', advancedFilters);
if (!finalFilters) {
throw new Error('Provide at least one filter or an advanced filter group.');
}
return dataForB2BRequest(context.auth.secret_text, '/search/people', {
filters: finalFilters,
count: count ?? 25,
offset: offset ?? 0,
enrich_live: enrichLive ?? false,
});
},
});