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:
@@ -21,6 +21,7 @@
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
IHttpRequestOptions,
|
||||
@@ -35,8 +36,10 @@ type ApiRequestFn = (
|
||||
variables?: IDataObject,
|
||||
) => Promise<IDataObject>;
|
||||
|
||||
type ApiRequestContext = IExecuteFunctions | IHookFunctions | ILoadOptionsFunctions;
|
||||
|
||||
async function proboGraphqlRequest(
|
||||
this: IExecuteFunctions | IHookFunctions,
|
||||
this: ApiRequestContext,
|
||||
apiPath: string,
|
||||
query: string,
|
||||
variables: IDataObject = {},
|
||||
@@ -82,7 +85,7 @@ async function proboGraphqlRequest(
|
||||
}
|
||||
|
||||
export async function proboApiRequest(
|
||||
this: IExecuteFunctions | IHookFunctions,
|
||||
this: ApiRequestContext,
|
||||
query: string,
|
||||
variables: IDataObject = {},
|
||||
): Promise<IDataObject> {
|
||||
@@ -160,7 +163,7 @@ export async function proboApiRequestAllItems(
|
||||
): Promise<IDataObject[]> {
|
||||
return proboGraphqlRequestAllItems.call(
|
||||
this,
|
||||
proboApiRequest,
|
||||
proboApiRequest as ApiRequestFn,
|
||||
query,
|
||||
variables,
|
||||
getConnection,
|
||||
@@ -179,7 +182,7 @@ export async function proboConnectApiRequestAllItems(
|
||||
): Promise<IDataObject[]> {
|
||||
return proboGraphqlRequestAllItems.call(
|
||||
this,
|
||||
proboConnectApiRequest,
|
||||
proboConnectApiRequest as ApiRequestFn,
|
||||
query,
|
||||
variables,
|
||||
getConnection,
|
||||
|
||||
Reference in New Issue
Block a user