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.2 KB
Raw Blame
import {
  createTrigger,
  PieceAuth,
  Property,
  TriggerStrategy,
} from '@activepieces/pieces-framework';

const markdown = `
- Go to the "Plugins" section.
- Find and click on the "Webhook" plugin to activate it.
- Now, locate the form where you want the trigger to occur.
- Add a webhook to that form.
- In the webhook settings, paste this URL: 
  \`\`\`text
  {{webhookUrl}}
  \`\`\`

- Keep the other settings unchanged (default).
`;

export const newSubmissionTrigger = createTrigger({
  name: 'new-submission',
  classification: 'READ',
  displayName: 'New Submission',
  auth: PieceAuth.None(),
  requireAuth: false,
  description: 'Triggers when form receives a new submission',
  aiMetadata: {
    description:
      'Fires when a Gravity Forms form on the connected WordPress site receives a new submission, delivered via the form\'s configured webhook. Each event represents one completed form entry and carries the submitted field values as its payload.',
  },
  props: {
    md: Property.MarkDown({
      value: markdown,
    }),
  },
  type: TriggerStrategy.WEBHOOK,
  sampleData: {},
  async onEnable() {
    return;
  },
  async onDisable() {
    return;
  },
  async run(context) {
    return [context.payload];
  },
});