@servicenow/sdk - v4.13.3
    Preparing search index...
    PlaybookDefinitionFunction: <
        const I extends Record<string, Column>,
        const O extends Record<string, Column>,
        const P extends string | undefined = undefined,
        const E extends PlaybookExecutionType | undefined = undefined,
        const PA extends boolean | undefined = undefined,
        const V extends
            Record<string, VariantDefinition> = Record<string, VariantDefinition>,
    >(
        config: PlaybookConfig<I, O> & {
            allowAsNested?: E extends "on_demand" ? boolean : false;
            executionType?: E;
            launcherRecordFormView?: E extends "on_demand"
                ? never
                : string
                | Record<"sys_ui_view">;
            launcherShowRecordForm?: E extends "on_demand" ? never : boolean;
            launcherTemplateFields?: E extends "on_demand"
                ? never
                : | string
                | (
                    P extends TableName
                        ? TemplateValueElement<P>
                        : Record<string, unknown>
                );
            parentTable?: E extends "on_demand" ? never : P;
            publicAccess?: E extends "on_demand" ? never : PA;
        },
        dependentConfig: PlaybookDependentConfig<I, P, E, V>,
        body: PlaybookBody<I, P, E, PA, V>,
    ) => { type: "playbook" }

    Main API for defining Playbooks with the 3-argument pattern.

    Type Declaration

      • <
            const I extends Record<string, Column>,
            const O extends Record<string, Column>,
            const P extends string | undefined = undefined,
            const E extends PlaybookExecutionType | undefined = undefined,
            const PA extends boolean | undefined = undefined,
            const V extends
                Record<string, VariantDefinition> = Record<string, VariantDefinition>,
        >(
            config: PlaybookConfig<I, O> & {
                allowAsNested?: E extends "on_demand" ? boolean : false;
                executionType?: E;
                launcherRecordFormView?: E extends "on_demand"
                    ? never
                    : string
                    | Record<"sys_ui_view">;
                launcherShowRecordForm?: E extends "on_demand" ? never : boolean;
                launcherTemplateFields?: E extends "on_demand"
                    ? never
                    : | string
                    | (
                        P extends TableName
                            ? TemplateValueElement<P>
                            : Record<string, unknown>
                    );
                parentTable?: E extends "on_demand" ? never : P;
                publicAccess?: E extends "on_demand" ? never : PA;
            },
            dependentConfig: PlaybookDependentConfig<I, P, E, V>,
            body: PlaybookBody<I, P, E, PA, V>,
        ): { type: "playbook" }
      • Type Parameters

        Parameters

        • config: PlaybookConfig<I, O> & {
              allowAsNested?: E extends "on_demand" ? boolean : false;
              executionType?: E;
              launcherRecordFormView?: E extends "on_demand"
                  ? never
                  : string
                  | Record<"sys_ui_view">;
              launcherShowRecordForm?: E extends "on_demand" ? never : boolean;
              launcherTemplateFields?: E extends "on_demand"
                  ? never
                  : | string
                  | (
                      P extends TableName
                          ? TemplateValueElement<P>
                          : Record<string, unknown>
                  );
              parentTable?: E extends "on_demand" ? never : P;
              publicAccess?: E extends "on_demand" ? never : PA;
          }

          Top-level playbook properties AND declarative state (inputs and outputs). Maps to sys_pd_process_definition + child sys_pd_process_input/output records. parentTable and publicAccess are disallowed when executionType is 'on_demand' — on-demand playbooks have no triggering record, and a public playbook must be tied to one. allowAsNested can only be true when executionType is 'on_demand'. launcherShowRecordForm, launcherRecordFormView, and launcherTemplateFields cannot be set when executionType is 'on_demand'.

        • dependentConfig: PlaybookDependentConfig<I, P, E, V>

          Object containing the triggers array of PlaybookTrigger(...) instances, optional permissions, and optional variants. Depends on the 1st-arg config: the typed inputs schema I enables left-side mapper-key intellisense and required-input warnings, parentTable P types params.parentRecord in the permissions/variants callbacks, and executionType E makes triggers unconfigurable (omitted entirely) when set to 'on_demand'. Variants declared here are exposed to the 3rd-arg lanes callback as params.variants.<name>.

        • body: PlaybookBody<I, P, E, PA, V>

          Declarative body with lanes. Execution ordering is declared via startRule on each lane and activity config. When the config sets publicAccess: true, every lane and activity here must be built from activity definitions marked publicAccess: true.

        Returns { type: "playbook" }