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/core-utils';
import type { OutputSchema } from '@activepieces/pieces-framework';
import { PieceAudienceFilter } from '@activepieces/shared';
import { piecesHooks } from './pieces-hooks';
function usePieceOutputSchema({
pieceName,
pieceVersion,
stepName,
}: {
pieceName?: string;
pieceVersion?: string;
stepName?: string;
}): OutputSchema | null {
const { pieceModel } = piecesHooks.usePiece({
name: pieceName ?? '',
version: pieceVersion,
enabled: !isNil(pieceName) && !isNil(stepName),
audience: PieceAudienceFilter.ALL,
});
if (!pieceModel || !stepName) return null;
const fromTrigger = pieceModel.triggers?.[stepName]?.outputSchema;
if (fromTrigger) return fromTrigger;
const fromAction = pieceModel.actions?.[stepName]?.outputSchema;
if (fromAction) return fromAction;
return null;
}
export { usePieceOutputSchema };