Workflows ReferenceType Definitions
SurfaceWorkflowArgs
type SurfaceWorkflowArgs = {
components?: string[];
context: WorkflowContext;
customerData: WorkflowCustomerData;
env: WorkflowEnv;
experiences: {
resolveAsJson: (experienceSlot, resolveOptions?) => Promise<object | null>;
resolveAsText: (experienceSlot, resolveOptions?) => Promise<string>;
resolveAsWebContent: (experienceSlot, resolveOptions?) => Promise<WebElement[]>;
};
features: Record<string, Record<string, SurfaceWorkflowProperty>>;
identity: WorkflowIdentity;
resource: WorkflowResource;
surfaceProperties?: Record<string, unknown>;
utils: WorkflowUtils & WorkflowOfferEngineUtils & WorkflowStripeSubscriptionUtils;
};Properties
components?
optional components?: string[];Slugs of the components that will run after this workflow.
Narrowed by components on the surface decision request; all components when it is omitted.
context
context: WorkflowContext;customerData
customerData: WorkflowCustomerData;env
env: WorkflowEnv;experiences
experiences: {
resolveAsJson: (experienceSlot, resolveOptions?) => Promise<object | null>;
resolveAsText: (experienceSlot, resolveOptions?) => Promise<string>;
resolveAsWebContent: (experienceSlot, resolveOptions?) => Promise<WebElement[]>;
};Resolve the experiences linked to this surface via experience slots. Resolved experiences can be returned in the required format to drive the behavior of your surface.
-
resolveAsJson
resolveAsJson: (experienceSlot, resolveOptions?) => Promise<object | null>;Resolve an experience slot as JSON.
Parameters
Parameter Type experienceSlotstringresolveOptions?ExperienceResolveOptionsReturns
Promise<object|null> -
resolveAsText
resolveAsText: (experienceSlot, resolveOptions?) => Promise<string>;Resolve an experience slot as plain text.
Parameters
Parameter Type experienceSlotstringresolveOptions?ExperienceResolveOptionsReturns
Promise<string> -
resolveAsWebContent
resolveAsWebContent: (experienceSlot, resolveOptions?) => Promise<WebElement[]>;Resolve an experience slot as Web Content. For use in components of Web Content surfaces.
Parameters
Parameter Type experienceSlotstringresolveOptions?ExperienceResolveOptionsReturns
Promise<WebElement[]>
features
features: Record<string, Record<string, SurfaceWorkflowProperty>>;identity
identity: WorkflowIdentity;resource
resource: WorkflowResource;surfaceProperties?
optional surfaceProperties?: Record<string, unknown>;utils
utils: WorkflowUtils & WorkflowOfferEngineUtils & WorkflowStripeSubscriptionUtils;