Skip to content

Conversation

@FriederikeHanssen
Copy link
Member

Adds ability to specify comma-separated label names when launching workflows. Labels are automatically created if they don't exist in the workspace, following the same approach as tower-cli. The node resolves label names to IDs and includes them in the launch request.

  • Add labels field to workflow-launch node UI
  • Implement label name resolution and auto-creation
  • Support labels for both regular and resume workflows
  • Use workspaceId as query parameter per tower-cli implementation
  • Convert label IDs to strings as required by API
  • Add comprehensive error handling for label operations

🤖 Generated with Claude Code

Adds ability to specify comma-separated label names when launching workflows.
Labels are automatically created if they don't exist in the workspace, following
the same approach as tower-cli. The node resolves label names to IDs and includes
them in the launch request.

- Add labels field to workflow-launch node UI
- Implement label name resolution and auto-creation
- Support labels for both regular and resume workflows
- Use workspaceId as query parameter per tower-cli implementation
- Convert label IDs to strings as required by API
- Add comprehensive error handling for label operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@github-actions
Copy link

github-actions bot commented Dec 22, 2025

🐳 Docker PR Build

Status ✅ Built successfully
Commit aed3bc2432735fdaf49e0ff353b45fa547628ffd
Standard ghcr.io/seqeralabs/node-red-seqera:pr-34
Studios ghcr.io/seqeralabs/node-red-seqera-studios:pr-34

View workflow run

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff!

Had a read through of the code, generally looks great - just a few minor comments.

FriederikeHanssen and others added 2 commits December 22, 2025 16:38
Address PR #34 review feedback by refactoring label resolution logic:

- Extract duplicate code into resolveLabelIds helper function
- Add case-insensitive label handling (normalize to lowercase)
- Change from warnings to errors for fail-fast behavior on label failures
- Fix error handling to pass msg parameter for proper Node-RED context
- Use search parameter in API calls to avoid pagination issues
- Remove redundant header specifications (handled by apiCall utility)

This improves code maintainability, scalability, and error handling while
ensuring labels with different casing are treated as the same label.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Consolidate label resolution to single location after both regular launch
and resume workflow paths have set up body.launch. Both code paths
ultimately populate body.launch, so labels can be applied once instead of
duplicating the logic in two places.

Fix permission requirements in error messages and documentation:
- Change from incorrect "label:write" permission to "Maintain role or higher"
- Workspace labels (used by this node) can be created by Maintain role
- Resource labels (for cost tracking) require Admin/Owner roles

This reduces code duplication and provides accurate guidance to users about
required token permissions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. Haven't tested it myself but if it's working for you then I'm happy.

Could you please ask @claude to add some unit tests (we have those now), then should be good to merge 👍🏻

Thanks!

Adds 8 new test cases for workflow-launch node labels feature:
- Label resolution and ID mapping for existing labels
- Automatic label creation when labels don't exist
- Permission error handling (403) with helpful error messages
- Case-insensitive label matching
- Whitespace trimming in comma-separated labels
- Empty label handling
- Integration with resume workflow functionality
- Dynamic labels from message properties (typedInput)

Also adds helper factories (createLabelsResponse, createLabelResponse)
to test/helper.js for mocking Seqera API label endpoints.

All 173 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants