Add Activepieces integration for workflow automation
- Add Activepieces fork with SmoothSchedule custom piece - Create integrations app with Activepieces service layer - Add embed token endpoint for iframe integration - Create Automations page with embedded workflow builder - Add sidebar visibility fix for embed mode - Add list inactive customers endpoint to Public API - Include SmoothSchedule triggers: event created/updated/cancelled - Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
101
activepieces-fork/packages/pieces/community/flowise/src/index.ts
Normal file
101
activepieces-fork/packages/pieces/community/flowise/src/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import { createCustomApiCallAction } from '@activepieces/pieces-common';
|
||||
import {
|
||||
createAction,
|
||||
createPiece,
|
||||
PieceAuth,
|
||||
Property,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
|
||||
const flowiseAuth = PieceAuth.CustomAuth({
|
||||
description: 'Enter your Flowise URL and API Key',
|
||||
props: {
|
||||
base_url: Property.ShortText({
|
||||
displayName: 'Base URL',
|
||||
description: 'Enter the base URL',
|
||||
required: true,
|
||||
}),
|
||||
access_token: PieceAuth.SecretText({
|
||||
displayName: 'API Key',
|
||||
description: 'Enter the API Key',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
required: true,
|
||||
});
|
||||
|
||||
// /api/v1/prediction/{your-chatflowid}
|
||||
export const flowisePredict = createAction({
|
||||
name: 'make_prediction',
|
||||
displayName: 'Make Prediction',
|
||||
description: 'Run Flowise Predict',
|
||||
auth: flowiseAuth,
|
||||
props: {
|
||||
chatflow_id: Property.ShortText({
|
||||
displayName: 'Chatflow ID',
|
||||
description: 'Enter the Chatflow ID',
|
||||
required: true,
|
||||
}),
|
||||
input: Property.ShortText({
|
||||
displayName: 'Input/Question',
|
||||
description: 'Enter the Input/Question',
|
||||
required: true,
|
||||
}),
|
||||
history: Property.Json({
|
||||
displayName: 'History',
|
||||
description: 'Enter the History',
|
||||
required: false,
|
||||
}),
|
||||
overrideConfig: Property.Json({
|
||||
displayName: 'Override Config',
|
||||
description: 'Enter the Override Config',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run(ctx) {
|
||||
const { base_url, access_token } = ctx.auth.props;
|
||||
const chatflow_id = ctx.propsValue['chatflow_id'];
|
||||
const input = ctx.propsValue['input'];
|
||||
const url = `${base_url}/api/v1/prediction/${chatflow_id}`;
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${access_token}`,
|
||||
};
|
||||
const body = {
|
||||
question: input,
|
||||
history: ctx.propsValue['history'],
|
||||
overrideConfig: ctx.propsValue['overrideConfig'],
|
||||
};
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
const data = await response.json();
|
||||
return data;
|
||||
},
|
||||
});
|
||||
|
||||
export const flowise = createPiece({
|
||||
displayName: 'Flowise',
|
||||
description: 'No-Code AI workflow builder',
|
||||
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/flowise.png',
|
||||
auth: flowiseAuth,
|
||||
minimumSupportedRelease: '0.30.0',
|
||||
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
||||
authors: ["aasimsani","kishanprmr","MoShizzle","abuaboud"],
|
||||
actions: [
|
||||
flowisePredict,
|
||||
createCustomApiCallAction({
|
||||
baseUrl: (auth) => (auth?.props.base_url ?? ''),
|
||||
auth: flowiseAuth,
|
||||
authMapping: async (auth) => ({
|
||||
Authorization: `Bearer ${
|
||||
auth.props.access_token
|
||||
}`,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
triggers: [],
|
||||
});
|
||||
Reference in New Issue
Block a user