Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ NEXT_PUBLIC_GITHUB_CLIENT_ID=

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
NEXT_PUBLIC_GOOGLE_CLIENT_ID=
NEXT_PUBLIC_GOOGLE_CLIENT_ID=

# Workflow SDK World (leave unset for local world auto-detection in dev)
# WORKFLOW_TARGET_WORLD=@workflow/world-postgres
# WORKFLOW_POSTGRES_URL=postgresql://postgres:postgres@localhost:5433/keeperhub
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# misc
.DS_Store
*.pem
.workflow-data/

# OS files
Thumbs.db
Expand Down
35 changes: 35 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Force-hoist the full transitive dependency tree of @workflow/world-postgres.
# Next.js standalone output tracing cannot follow the dynamic
# require(process.env.WORKFLOW_TARGET_WORLD) in the workflow SDK.
# pnpm strict mode keeps transitive deps in .pnpm/ where the
# outputFileTracingIncludes globs in next.config.ts can't reach them.
#
# Regenerate with: node scripts/list-world-deps.mjs
public-hoist-pattern[]=@vercel/oidc
public-hoist-pattern[]=@vercel/queue
public-hoist-pattern[]=@workflow/*
public-hoist-pattern[]=async-sema
public-hoist-pattern[]=cbor-x
public-hoist-pattern[]=cbor-extract
public-hoist-pattern[]=cron-parser
public-hoist-pattern[]=luxon
public-hoist-pattern[]=mixpart
public-hoist-pattern[]=ms
public-hoist-pattern[]=pg
public-hoist-pattern[]=pg-boss
public-hoist-pattern[]=pg-connection-string
public-hoist-pattern[]=pg-int8
public-hoist-pattern[]=pg-pool
public-hoist-pattern[]=pg-protocol
public-hoist-pattern[]=pg-types
public-hoist-pattern[]=pgpass
public-hoist-pattern[]=postgres-array
public-hoist-pattern[]=postgres-bytea
public-hoist-pattern[]=postgres-date
public-hoist-pattern[]=postgres-interval
public-hoist-pattern[]=serialize-error
public-hoist-pattern[]=split2
public-hoist-pattern[]=type-fest
public-hoist-pattern[]=ulid
public-hoist-pattern[]=undici
public-hoist-pattern[]=xtend
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ When you must use an ignore comment:
- **Database**: PostgreSQL + Drizzle ORM
- **Testing**: Vitest (unit/integration), Playwright (E2E)
- **AI**: Vercel AI SDK with Anthropic/OpenAI
- **Workflow**: Workflow DevKit 4.0.1-beta.17
- **Workflow**: Workflow DevKit 4.1.0-beta.51
- **Package Manager**: pnpm

## Project Structure
Expand Down
6 changes: 3 additions & 3 deletions app/api/workflow/[workflowId]/execute/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ async function executeWorkflowBackground(
});

// Use start() from workflow/api to properly execute the workflow
start(executeWorkflow, [
const run = await start(executeWorkflow, [
{
nodes,
edges,
triggerInput: input,
executionId,
workflowId, // Pass workflow ID so steps can fetch credentials
workflowId,
},
]);

console.log("[Workflow Execute] Workflow started successfully");
console.log("[Workflow Execute] Workflow started, runId:", run.runId);
} catch (error) {
console.error("[Workflow Execute] Error during execution:", error);
console.error(
Expand Down
4 changes: 2 additions & 2 deletions app/api/workflows/[workflowId]/webhook/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function executeWorkflowBackground(
workflowId,
});

start(executeWorkflow, [
const run = await start(executeWorkflow, [
{
nodes,
edges,
Expand All @@ -105,7 +105,7 @@ async function executeWorkflowBackground(
},
]);

console.log("[Webhook] Workflow started successfully");
console.log("[Webhook] Workflow started, runId:", run.runId);
} catch (error) {
console.error("[Webhook] Error during execution:", error);
console.error(
Expand Down
21 changes: 19 additions & 2 deletions deploy/keeperhub/prod/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ shared_env: &shared_env
type: parameterStore
name: db-url
parameter_name: /eks/maker-prod/keeperhub/db-url
WORKFLOW_POSTGRES_URL:
type: parameterStore
name: workflow-postgres-url
parameter_name: /eks/maker-prod/keeperhub/db-url
CHAIN_RPC_CONFIG:
type: parameterStore
name: chain-rpc-config
Expand Down Expand Up @@ -50,6 +54,19 @@ deployment:
- -c
args:
- |
echo "Setting up workflow postgres tables..."
export WORKFLOW_POSTGRES_URL=$(node -e "
const u = process.env.WORKFLOW_POSTGRES_URL || process.env.DATABASE_URL || '';
try { new URL(u); console.log(u); } catch {
const s = u.indexOf('://') + 3;
const a = u.lastIndexOf('@');
const c = u.indexOf(':', s);
if (s > 3 && a > c && c > s) {
console.log(u.slice(0, s) + encodeURIComponent(u.slice(s, c)) + ':' + encodeURIComponent(u.slice(c + 1, a)) + u.slice(a));
} else { console.log(u); }
}
")
pnpm exec workflow-postgres-setup
echo "Running database migrations..."
pnpm db:push
echo "Seeding chains..."
Expand Down Expand Up @@ -114,9 +131,9 @@ env:
PARA_ENVIRONMENT:
type: kv
value: "prod"
WORKFLOW_EMBEDDED_DATA_DIR:
WORKFLOW_TARGET_WORLD:
type: kv
value: "/tmp/workflow-data"
value: "@workflow/world-postgres"
NEXT_PUBLIC_API_URL:
type: kv
value: "http://localhost:3000"
Expand Down
21 changes: 19 additions & 2 deletions deploy/keeperhub/staging/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ shared_env: &shared_env
type: parameterStore
name: db-url
parameter_name: /eks/maker-staging/keeperhub/db-url
WORKFLOW_POSTGRES_URL:
type: parameterStore
name: workflow-postgres-url
parameter_name: /eks/maker-staging/keeperhub/db-url
CHAIN_RPC_CONFIG:
type: parameterStore
name: chain-rpc-config
Expand Down Expand Up @@ -50,6 +54,19 @@ deployment:
- -c
args:
- |
echo "Setting up workflow postgres tables..."
export WORKFLOW_POSTGRES_URL=$(node -e "
const u = process.env.WORKFLOW_POSTGRES_URL || process.env.DATABASE_URL || '';
try { new URL(u); console.log(u); } catch {
const s = u.indexOf('://') + 3;
const a = u.lastIndexOf('@');
const c = u.indexOf(':', s);
if (s > 3 && a > c && c > s) {
console.log(u.slice(0, s) + encodeURIComponent(u.slice(s, c)) + ':' + encodeURIComponent(u.slice(c + 1, a)) + u.slice(a));
} else { console.log(u); }
}
")
pnpm exec workflow-postgres-setup
echo "Running database migrations..."
pnpm db:push
echo "Seeding chains..."
Expand Down Expand Up @@ -114,9 +131,9 @@ env:
PARA_ENVIRONMENT:
type: kv
value: "beta"
WORKFLOW_EMBEDDED_DATA_DIR:
WORKFLOW_TARGET_WORLD:
type: kv
value: "/tmp/workflow-data"
value: "@workflow/world-postgres"
NEXT_PUBLIC_API_URL:
type: kv
value: "http://localhost:3000"
Expand Down
20 changes: 18 additions & 2 deletions deploy/pr-environment/values.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ shared_env: &shared_env
DATABASE_URL:
type: kv
value: "postgresql://keeperhub:${DB_PASSWORD}@keeperhub-pr-${PR_NUMBER}-db-rw.pr-${PR_NUMBER}.svc.cluster.local:5432/keeperhub"
WORKFLOW_POSTGRES_URL:
type: kv
value: "postgresql://keeperhub:${DB_PASSWORD}@keeperhub-pr-${PR_NUMBER}-db-rw.pr-${PR_NUMBER}.svc.cluster.local:5432/keeperhub"
CHAIN_RPC_CONFIG:
type: parameterStore
name: chain-rpc-config
Expand Down Expand Up @@ -52,6 +55,19 @@ deployment:
- -c
args:
- |
echo "Setting up workflow postgres tables..."
export WORKFLOW_POSTGRES_URL=$(node -e "
const u = process.env.WORKFLOW_POSTGRES_URL || process.env.DATABASE_URL || '';
try { new URL(u); console.log(u); } catch {
const s = u.indexOf('://') + 3;
const a = u.lastIndexOf('@');
const c = u.indexOf(':', s);
if (s > 3 && a > c && c > s) {
console.log(u.slice(0, s) + encodeURIComponent(u.slice(s, c)) + ':' + encodeURIComponent(u.slice(c + 1, a)) + u.slice(a));
} else { console.log(u); }
}
")
pnpm exec workflow-postgres-setup
echo "Running database migrations..."
pnpm db:push
echo "Seeding chains..."
Expand Down Expand Up @@ -105,9 +121,9 @@ env:
PARA_ENVIRONMENT:
type: kv
value: "beta"
WORKFLOW_EMBEDDED_DATA_DIR:
WORKFLOW_TARGET_WORLD:
type: kv
value: "/tmp/workflow-data"
value: "@workflow/world-postgres"
NEXT_PUBLIC_API_URL:
type: kv
value: "http://localhost:3000"
Expand Down
Loading