Skip to content

project: pull crashes with 'step not found' when two workflow names slugify to the same id #1602

Open

Description

@midigofrank

Problem

openfn project pull fails while serializing when a project has two workflows whose names slugify to the same id:

✘ Error: step not found: common
    at extractStep (@openfn/project/dist/index.js)
    at Object.to_fs_default
    at _Project.serialize

Seen in the GitHub sync action (openfn/cli-pull-action@v2) against a staging project with these two workflows:

  • Event-based workflow 1 rename: steps webhook, transform-data, http-1, http, http-2
  • Event-based workflow 1 (rename): steps webhook, common, http, transform-data

Both slugify to event-based-workflow-1-rename.

Cause

  • parse/from-app-state.ts sets mapped.id = slugify(workflow.name) and does not check for duplicate ids.
  • serialize/to-fs.ts loops over project.workflows but calls extractStep(project, wf.id, s.id). That function looks the workflow up again with project.getWorkflow(id), which returns the first match. While processing the second workflow it searches the first one's steps, and common isn't there.

If the step ids happen to overlap, nothing throws, but the workflows overwrite each other's files. Here webhook, http and transform-data were written from the wrong workflow with no error, and both workflow files share the same path.

Repro

Create two workflows in Lightning named Foo and Foo! (or foo), give the second one a step the first doesn't have, then run openfn project pull.

Suggested fix

Make workflow ids unique when they collide in from-app-state.ts, for example by adding a -2 suffix, or fail with an error that names both workflows. Passing wf directly into extractStep/extractWorkflow would stop the crash, but the workflows would still overwrite each other's files.

Workaround

Rename one of the colliding workflows in Lightning.

Activity

  1. midigofrank commented on Oct 29, 2026

    @midigofrank
    ContributorAuthor

    Related: #1603 is the same problem at the step level. Step names with no ASCII characters slugify to "" and collide. A shared fix (keep Unicode in slugify and catch duplicate ids for both workflows and steps) would cover both issues.

  2. self-assigned this
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    New Issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions