Public API: endpoints to list and create execution annotation tags

The idea is:

Add two endpoints to the n8n public API:

  • GET /api/v1/annotation-tags: list execution annotation tags (paginated, same format as GET /tags).
  • POST /api/v1/annotation-tags: create an execution annotation tag by name (201 on success, 409 if the name already exists, 400 for an invalid name).

They need two new API key scopes: annotationTag:list and annotationTag:create (for owner, admin and member roles). The PUT /executions/{id}/tags endpoint stays unchanged.

My use case:

I tag executions with a ticket number (for example “API-123”) from a workflow, using the public API. PUT /executions/{id}/tags accepts only IDs of existing annotation tags. The
public API has no way to list or create these tags:

  • The /tags endpoints manage workflow tags. They are a different entity, so their IDs are rejected (“Some tags not found”).
  • The internal /rest/annotation-tags endpoints return 401 with an API key.
    So a tag for a new ticket must first be created by hand in the UI, and the automation cannot work alone.

I think it would be beneficial to add this because:

The execution tags endpoint is already public, but it cannot be used on its own. With these two endpoints, a client with an API key can create a tag and assign it to an execution.
The change is small: the controller reuses the existing AnnotationTagService, the existing tag DTOs and the existing scopes of the internal REST API.

Any resources to support this?

Are you willing to work on this?

Yes. The implementation is already in the draft pull request above.

This makes sense, since PUT /executions/{id}/tags isn’t much use if a workflow can’t create the tag ID it needs first. If this gets added, would you want POST to return the existing tag’s ID on a duplicate name instead of a 409? That way a workflow could create or reuse a tag in one call.

Thanks for the feedback!

I would keep 409 on a duplicate name. The existing public POST /tags endpoint
already returns 409 for a duplicate, so this keeps the two consistent. A POST
that sometimes returns 201 (created) and sometimes 200 (existing) also changes
the meaning of “create” and can surprise clients.

To make “create or reuse” easy, I can add an optional exact-match name filter
to GET /annotation-tags. Then a workflow does: POST; on 409, GET ?name=
and use the returned id.

Would that work for you?