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 { isNil } from '@activepieces/shared';
function resolveSelected({
projectId,
reachableProjectIds,
}: {
projectId: string | null;
reachableProjectIds: string[] | null;
}): string | null {
if (isNil(reachableProjectIds) || reachableProjectIds.length === 0) {
return projectId;
}
if (!isNil(projectId) && reachableProjectIds.includes(projectId)) {
return projectId;
}
return reachableProjectIds[0];
}
export const reachableProjectUtils = { resolveSelected };