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

1.1 KB
Raw Blame
import { createAction, Property } from '@activepieces/pieces-framework';
import { enrichlayerAuth } from '../auth';
import { enrichlayerApiCall } from '../common/client';
import { ENDPOINTS } from '../common/constants';

export const getJobProfile = createAction({
  name: 'get_job_profile',
  auth: enrichlayerAuth,
  displayName: 'Get Job Profile',
  description:
    'Get structured data of a job posting (2 credits)',
  audience: 'both',
  aiMetadata: {
    description:
      'Retrieve full structured data for a single job posting from its professional-network job URL. Read-only and safe to retry. Use when you have a specific job URL; to discover job postings for a company use Search Company Jobs first.',
    idempotent: true,
  },
  props: {
    url: Property.ShortText({
      displayName: 'Job URL',
      description:
        'Professional network job URL (e.g., https://www.linkedin.com/jobs/view/4222036951/)',
      required: true,
    }),
  },
  async run(context) {
    return await enrichlayerApiCall(
      context.auth.secret_text as string,
      ENDPOINTS.JOB_PROFILE,
      {
        url: context.propsValue.url,
      },
    );
  },
});