From 1127cbf0ef8c9ddd0c29e64d6f9adca6ff457883 Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Mon, 24 Nov 2025 14:42:31 -0600 Subject: [PATCH 1/3] add deploy badge --- README.md | 20 ++++++++++++-------- lib/constants.ts | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c558183b1..6ca48e931 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,18 @@ A template for building your own workflow automation platform. Built on top of W ![Workflow Builder Screenshot](screenshot.png) +## Deploy Your Own + +You can deploy your own version of the workflow builder to Vercel with one click: + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fworkflow-builder-template&project-name=workflow-builder&repository-name=workflow-builder&demo-title=Workflow%20Builder&demo-description=A%20free%2C%20open-source%20template%20for%20building%20visual%20workflow%20automation%20platforms%20with%20real%20integrations%20and%20code%20generation&demo-url=https%3A%2F%2Fworkflow-builder-template.vercel.app&demo-image=https%3A%2F%2Fraw.githubusercontent.com%2Fvercel-labs%2Fworkflow-builder-template%2Fmain%2Fscreenshot.png&env=BETTER_AUTH_SECRET,INTEGRATION_ENCRYPTION_KEY,AI_GATEWAY_API_KEY&envDescription=Required+environment+variables+for+the+workflow+builder&stores=%5B%7B%22type%22%3A%22postgres%22%7D%5D) + +**What happens during deployment:** + +- **Automatic Database Setup**: A Neon Postgres database is automatically created and connected to your project +- **Environment Configuration**: You'll be prompted to provide required environment variables (Better Auth credentials and AI Gateway API key) +- **Ready to Use**: After deployment, you can start building workflows immediately + ## What's Included - **Visual Workflow Builder** - Drag-and-drop interface powered by React Flow @@ -71,14 +83,6 @@ Visit [http://localhost:3000](http://localhost:3000) to get started. - **Database Query** - Query or update PostgreSQL - **HTTP Request** - Call external APIs -### Condition Nodes - -- Conditional branching based on data - -### Transform Nodes - -- Data transformation and mapping - ## Code Generation Workflows can be converted to executable TypeScript code with the `"use workflow"` directive: diff --git a/lib/constants.ts b/lib/constants.ts index b83fc0f8f..21d538d54 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,6 +1,6 @@ // Vercel deployment configuration export const VERCEL_DEPLOY_URL = - "https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fworkflow-builder-template&env=DATABASE_URL,BETTER_AUTH_SECRET,BETTER_AUTH_URL,VERCEL_API_TOKEN,OPENAI_API_KEY&envDescription=Required+environment+variables+for+workflow-builder-template.+See+README+for+details.&stores=%5B%7B%22type%22%3A%22postgres%22%7D%5D&project-name=workflow-builder-template&repository-name=workflow-builder-template"; + "https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fworkflow-builder-template&project-name=workflow-builder&repository-name=workflow-builder&demo-title=Workflow%20Builder&demo-description=A%20free%2C%20open-source%20template%20for%20building%20visual%20workflow%20automation%20platforms%20with%20real%20integrations%20and%20code%20generation&demo-url=https%3A%2F%2Fworkflow-builder-template.vercel.app&demo-image=https%3A%2F%2Fraw.githubusercontent.com%2Fvercel-labs%2Fworkflow-builder-template%2Fmain%2Fscreenshot.png&env=BETTER_AUTH_SECRET,INTEGRATION_ENCRYPTION_KEY,AI_GATEWAY_API_KEY&envDescription=BETTER_AUTH_SECRET+and+INTEGRATION_ENCRYPTION_KEY+are+required+secrets.+AI_GATEWAY_API_KEY+is+optional.&stores=%5B%7B%22type%22%3A%22postgres%22%7D%5D"; // Vercel button URL for markdown export const VERCEL_DEPLOY_BUTTON_URL = `[![Deploy with Vercel](https://vercel.com/button)](${VERCEL_DEPLOY_URL})`; From 2d5f25ab4679a3ba46064d4707baecc8fa07ad3d Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Mon, 24 Nov 2025 14:45:48 -0600 Subject: [PATCH 2/3] fix validation --- README.md | 2 +- lib/db/integrations.ts | 22 +++++++++++----------- vercel-template.json | 1 - 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6ca48e931..29410e484 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A template for building your own workflow automation platform. Built on top of W You can deploy your own version of the workflow builder to Vercel with one click: -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fworkflow-builder-template&project-name=workflow-builder&repository-name=workflow-builder&demo-title=Workflow%20Builder&demo-description=A%20free%2C%20open-source%20template%20for%20building%20visual%20workflow%20automation%20platforms%20with%20real%20integrations%20and%20code%20generation&demo-url=https%3A%2F%2Fworkflow-builder-template.vercel.app&demo-image=https%3A%2F%2Fraw.githubusercontent.com%2Fvercel-labs%2Fworkflow-builder-template%2Fmain%2Fscreenshot.png&env=BETTER_AUTH_SECRET,INTEGRATION_ENCRYPTION_KEY,AI_GATEWAY_API_KEY&envDescription=Required+environment+variables+for+the+workflow+builder&stores=%5B%7B%22type%22%3A%22postgres%22%7D%5D) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fworkflow-builder-template&project-name=workflow-builder&repository-name=workflow-builder&demo-title=Workflow%20Builder&demo-description=A%20free%2C%20open-source%20template%20for%20building%20visual%20workflow%20automation%20platforms%20with%20real%20integrations%20and%20code%20generation&demo-url=https%3A%2F%2Fworkflow-builder-template.vercel.app&demo-image=https%3A%2F%2Fraw.githubusercontent.com%2Fvercel-labs%2Fworkflow-builder-template%2Fmain%2Fscreenshot.png&env=BETTER_AUTH_SECRET,INTEGRATION_ENCRYPTION_KEY,AI_GATEWAY_API_KEY&envDescription=BETTER_AUTH_SECRET+and+INTEGRATION_ENCRYPTION_KEY+are+required+secrets.+AI_GATEWAY_API_KEY+is+optional.&stores=%5B%7B%22type%22%3A%22postgres%22%7D%5D) **What happens during deployment:** diff --git a/lib/db/integrations.ts b/lib/db/integrations.ts index 93c674f37..7a186fe68 100644 --- a/lib/db/integrations.ts +++ b/lib/db/integrations.ts @@ -1,6 +1,11 @@ import "server-only"; -import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto"; +import { + createCipheriv, + createDecipheriv, + createHash, + randomBytes, +} from "node:crypto"; import { and, eq } from "drizzle-orm"; import { db } from "./index"; import { integrations, type NewIntegration } from "./schema"; @@ -12,24 +17,19 @@ const ENCRYPTION_KEY_ENV = "INTEGRATION_ENCRYPTION_KEY"; /** * Get or generate encryption key from environment - * Key should be a 32-byte hex string (64 characters) + * Accepts any string and hashes it to a 32-byte key */ function getEncryptionKey(): Buffer { - const keyHex = process.env[ENCRYPTION_KEY_ENV]; + const keyString = process.env[ENCRYPTION_KEY_ENV]; - if (!keyHex) { + if (!keyString) { throw new Error( `${ENCRYPTION_KEY_ENV} environment variable is required for encrypting integration credentials` ); } - if (keyHex.length !== 64) { - throw new Error( - `${ENCRYPTION_KEY_ENV} must be a 64-character hex string (32 bytes)` - ); - } - - return Buffer.from(keyHex, "hex"); + // Hash the input string to get a consistent 32-byte key + return createHash("sha256").update(keyString).digest(); } /** diff --git a/vercel-template.json b/vercel-template.json index 44d9c167e..748a1aedc 100644 --- a/vercel-template.json +++ b/vercel-template.json @@ -8,4 +8,3 @@ } ] } - From 1ecb0560542e0e2884edf17fd4fea7bda5a2a92d Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Mon, 24 Nov 2025 15:19:57 -0600 Subject: [PATCH 3/3] revert --- lib/db/integrations.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/db/integrations.ts b/lib/db/integrations.ts index 7a186fe68..93c674f37 100644 --- a/lib/db/integrations.ts +++ b/lib/db/integrations.ts @@ -1,11 +1,6 @@ import "server-only"; -import { - createCipheriv, - createDecipheriv, - createHash, - randomBytes, -} from "node:crypto"; +import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto"; import { and, eq } from "drizzle-orm"; import { db } from "./index"; import { integrations, type NewIntegration } from "./schema"; @@ -17,19 +12,24 @@ const ENCRYPTION_KEY_ENV = "INTEGRATION_ENCRYPTION_KEY"; /** * Get or generate encryption key from environment - * Accepts any string and hashes it to a 32-byte key + * Key should be a 32-byte hex string (64 characters) */ function getEncryptionKey(): Buffer { - const keyString = process.env[ENCRYPTION_KEY_ENV]; + const keyHex = process.env[ENCRYPTION_KEY_ENV]; - if (!keyString) { + if (!keyHex) { throw new Error( `${ENCRYPTION_KEY_ENV} environment variable is required for encrypting integration credentials` ); } - // Hash the input string to get a consistent 32-byte key - return createHash("sha256").update(keyString).digest(); + if (keyHex.length !== 64) { + throw new Error( + `${ENCRYPTION_KEY_ENV} must be a 64-character hex string (32 bytes)` + ); + } + + return Buffer.from(keyHex, "hex"); } /**