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 { createAction } from '@activepieces/pieces-framework';
import { HttpMethod } from '@activepieces/pieces-common';
import { facebookPagesAuth } from '../../auth';
import { facebookPagesCommon, GraphList, GraphRecord } from '../../common/common';
import { scheduledPostsOutputSchema } from '../../output-schemas';
export const getScheduledPostsAction = createAction({
auth: facebookPagesAuth,
name: 'get_scheduled_posts',
classification: 'SEARCH',
displayName: 'Get Scheduled Posts',
description: 'Lists the scheduled, not yet published posts of a Facebook Page.',
audience: 'ai',
aiMetadata: {
description:
'List the posts on a Facebook Page that are scheduled but not yet published, with each post ID, message, created time and scheduled publish time. Use the IDs with Publish Scheduled Post, Reschedule Post or Delete Post. Paginated with After Cursor. Read-only.',
idempotent: true,
},
outputSchema: scheduledPostsOutputSchema,
props: {
pageId: facebookPagesCommon.pageId,
limit: facebookPagesCommon.limit,
after: facebookPagesCommon.after,
},
async run({ auth, propsValue }) {
const response = await facebookPagesCommon.pageRequest<GraphList<GraphRecord>>({
auth,
pageId: propsValue.pageId,
method: HttpMethod.GET,
path: `${facebookPagesCommon.objectPath({ id: propsValue.pageId })}/scheduled_posts`,
queryParams: {
fields: 'id,message,created_time,scheduled_publish_time,permalink_url,is_published,full_picture',
...facebookPagesCommon.cursorQuery({ limit: propsValue.limit, after: propsValue.after }),
},
});
return facebookPagesCommon.toCursorPage({ response });
},
});