@servicenow/sdk - v4.13.3
    Preparing search index...

    Type Alias PlaybookDependentConfig<I, P, E, V>

    PlaybookDependentConfig: {
        permissions?: (params: PermissionParams<P, E>) => PlaybookPermissions;
        preservedAttachment?: {
            chunkSizeBytes: string;
            compressed: boolean;
            contentType: string;
            data: string[];
            fileName: string;
            hash: string;
            imageHeight: string;
            imageWidth: string;
            sizeBytes: string;
            sizeCompressed: string;
        };
        variants?: (params: PlaybookBodyParams<I, P, E>) => V;
    } & (
        E extends "on_demand"
            ? { triggers?: never }
            : { triggers: PlaybookTriggerInstance<I>[] }
    )

    Config-dependent declarations for a Playbook (Argument 2 of PlaybookDefinition).

    Holds the triggers array and optional permissions — declarations whose contents depend on the 1st-arg config (the inputs schema I, parentTable P, and executionType E). The I generic captures the declared inputs schema so each PlaybookTrigger() mapper is type-checked (left-side keys must be declared inputs; right-side trigger.current autocompletes the trigger table). The P generic types params.parentRecord in the permissions callback. The E generic narrows triggers to [] when executionType is 'on_demand'.

    Type Parameters

    Type Declaration

    • Optionalpermissions?: (params: PermissionParams<P, E>) => PlaybookPermissions

      Access control for the playbook. A callback receiving params (with the dot-walkable parentRecord, available when parentTable is set) and returning permission sets grouped by reference kind. Pills inside may reference params.parentRecord and wfa.playbook.activityRef(...).

    • OptionalpreservedAttachment?: {
          chunkSizeBytes: string;
          compressed: boolean;
          contentType: string;
          data: string[];
          fileName: string;
          hash: string;
          imageHeight: string;
          imageWidth: string;
          sizeBytes: string;
          sizeCompressed: string;
      }

      Framework-managed. Carries a preserved image attachment's raw record data (see "Image Attachments" in docs/guides/playbook-unsupported-features-guide.md) so it survives the Fluent authoring/build/deploy round trip. Populated automatically when transforming a process definition that has one — not meant to be set or edited by hand.

    • Optionalvariants?: (params: PlaybookBodyParams<I, P, E>) => V

      Variant definitions keyed by variant name. Enables conditional path selection via variant hierarchy. Declared here (rather than in the body) so activities in the 3rd-arg lanes callback can reference a variant directly as params.variants.<name> — no wrapping call needed. A variant's own parentVariant field references a sibling variant declared in this same callback directly by local identifier (not through params.variants), since both are in scope together.

    {
    permissions: (params) => ({
    users: [{ user: wfa.playbook.dataPill(params.parentRecord.assigned_to), view: true }],
    }),
    triggers: [
    PlaybookTrigger(
    PlaybookTriggerTypes.RecordCreate,
    { $id: ..., label: 'On Create' },
    { table: 'incident' },
    (trigger) => ({
    priority: wfa.playbook.dataPill(trigger.current.priority), // ← left + right intellisense
    }),
    ),
    ],
    }