KeeperHub / KeeperHub/keeperhub

workflowType reports "read" for newly created write-only workflows

Open Beginner friendly
#2,014 4 comments 0 reactions 0 assignees View on GitHub
accepted confirmed
Dominant language
TypeScript
Stars
24
Forks
93
Avg merge
1d 4h
Merged PRs (30d)
253

Description

## What

`deriveWorkflowType(nodes, requestedType)` (`lib/mcp/calldata.ts`) correctly classifies a workflow as `read`/`write` from its node actionTypes, and is already called from both places that update a workflow's `workflowType` (the PATCH handler and `lib/mcp/listing.ts`'s publish/patch paths) — but it is never called from `POST /api/workflows/create`. The `workflows.workflowType` column defaults to `"read"` (NOT NULL), so every newly created workflow reports `"read"` regardless of its actual nodes, until a later PATCH happens to correct it.

## How I ran into it

Found during the hackathon while inspecting a workflow I'd just created via `POST /api/workflows/create` with a single `web3/write-contract` node — the response reported `workflowType: "read"` despite the workflow having no read step at all.

Fix proposed in #2011.

Contributor guide

Open the contributing guide

Research direction

Start at the POST /api/workflows/create handler and read deriveWorkflowType in lib/mcp/calldata.ts, then compare the existing PATCH and lib/mcp/listing.ts publish/patch paths. Ensure creation derives workflowType from the submitted nodes so a write-only workflow is returned as write rather than the database default read.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.