Skip to content

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

974 B
Raw Blame
import { createAction } from '@activepieces/pieces-framework';
import { assemblyaiAuth } from '../../auth';
import { getAssemblyAIClient } from '../../client';
import { transcriptIdProp } from './shared-props';

export const getTranscript = createAction({
  name: 'getTranscript',
  classification: 'READ',
  auth: assemblyaiAuth,
  requireAuth: true,
  displayName: 'Get Transcript',
  description: 'Retrieves a transcript by its ID.',
  audience: 'both',
  aiMetadata: {
    description:
      'Fetches a single existing transcript by its ID, including its status and transcribed text. Use this to poll or read back a transcript created by the Transcribe action. Requires a valid transcript ID; read-only and idempotent.',
    idempotent: true,
  },
  props: {
    id: transcriptIdProp,
  },
  async run(context) {
    const client = getAssemblyAIClient(context);
    const transcript = await client.transcripts.get(context.propsValue.id);
    return transcript;
  },
});