MonetizationOS Docs
Workflows ReferenceType Definitions

MiddlewareWorkflowResult

type MiddlewareWorkflowResult = 
  | {
  action: "set_identifier";
  identity: MiddlewareWorkflowIdentityResult;
}
  | {
  action: "fail";
  httpStatusCode: number;
  message: string;
}
  | {
  action: "set_properties";
  properties: Record<string, unknown>;
}
  | {
  action: "append_bot_tag";
  category: WorkflowBotCategory;
  product?: string;
  verified: boolean;
};

The result of a middleware workflow.

  • set_identifier: Modifies the user's identity for downstream processing.
  • set_properties: Merges optional values into workflow context for downstream workflows.
  • fail: Rejects the request with an HTTP error response.

Union Members

Type Literal

{
  action: "set_identifier";
  identity: MiddlewareWorkflowIdentityResult;
}

Type Literal

{
  action: "fail";
  httpStatusCode: number;
  message: string;
}

action

action: "fail";

httpStatusCode

httpStatusCode: number;

The HTTP status code to respond with.

Example
403

message

message: string;

Type Literal

{
  action: "set_properties";
  properties: Record<string, unknown>;
}

Type Literal

{
  action: "append_bot_tag";
  category: WorkflowBotCategory;
  product?: string;
  verified: boolean;
}

On this page