Let n8n create and update campaigns with scope sources

Replace the separate Add Source operation with multi-select source
fields on create and update. Create passes accessReviewSourceIds to
the existing GraphQL input; update gains the same omittable field and
backend source sync so workflows can configure sources in one step.

Load source options from the organization in the n8n UI, and keep
surfacing INVALID errors when start fails for missing sources.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-07-20 15:37:36 +00:00
parent 2d93b1d793
commit ffaf637397
13 changed files with 335 additions and 107 deletions

View File

@@ -746,9 +746,10 @@ func (r *mutationResolver) UpdateAccessReviewCampaign(ctx context.Context, input
ctx,
scope,
accessreview.UpdateAccessReviewCampaignRequest{
CampaignID: input.AccessReviewCampaignID,
Name: gqlutils.UnwrapOmittable(input.Name),
Description: gqlutils.UnwrapOmittable(input.Description),
CampaignID: input.AccessReviewCampaignID,
Name: gqlutils.UnwrapOmittable(input.Name),
Description: gqlutils.UnwrapOmittable(input.Description),
AccessReviewSourceIDs: gqlutils.UnwrapOmittable(input.AccessReviewSourceIds),
},
)
if err != nil {
@@ -756,6 +757,10 @@ func (r *mutationResolver) UpdateAccessReviewCampaign(ctx context.Context, input
return nil, gqlutils.NotFound(ctx, err)
}
if strings.HasPrefix(err.Error(), "cannot update campaign:") {
return nil, gqlutils.Invalid(ctx, err)
}
r.logger.ErrorCtx(ctx, "cannot update access review campaign", log.Error(err))
return nil, gqlutils.Internal(ctx)

View File

@@ -588,6 +588,7 @@ input UpdateAccessReviewCampaignInput {
accessReviewCampaignId: ID!
name: String @goField(omittable: true)
description: String @goField(omittable: true)
accessReviewSourceIds: [ID!] @goField(omittable: true)
}
type UpdateAccessReviewCampaignPayload {