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 { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { createAction } from '@activepieces/pieces-framework';
import { fliqrConfig } from '../common/models';
import { fliqrAuth } from '../auth';

export const getFliqrAccountFlows = createAction({
  // auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
  name: 'get_fliqr_account_flows',
  classification: 'SEARCH',
  auth: fliqrAuth,
  displayName: 'Get Account Flows',
  description: 'Get all flows from the account',
  audience: 'both',
  aiMetadata: { description: 'Lists all chatbot flows configured on the authenticated Fliqr AI account. Use to discover the available flows (e.g. to find a flow id or confirm what automations exist) before referencing or triggering one. Read-only; repeating the call is safe.', idempotent: true },
  props: {},
  async run(context) {
    const res = await httpClient.sendRequest<string[]>({
      method: HttpMethod.GET,
      url: `${fliqrConfig.baseUrl}/accounts/flows`,
      headers: {
        [fliqrConfig.accessTokenHeaderKey]: context.auth.secret_text,
      }
    });
    return res.body;
  },
});