Skip to main content
The top-level @qawolf/flows entry point exposes cross-platform helpers and types.

Primary Exports

  • platform.target
  • configureTarget(...)
  • getCurrentScope()
  • resetTarget()
  • FailWithoutRetryError
It also re-exports:
  • type Target
  • type TargetScope
Example:
import {
  FailWithoutRetryError,
  configureTarget,
  getCurrentScope,
  platform,
  resetTarget,
} from "@qawolf/flows";
import type { Target } from "@qawolf/flows";

declare const target: Target;

configureTarget({ target });

const currentTarget = platform.target;
const currentScope = getCurrentScope();

if (!currentScope) {
  throw new FailWithoutRetryError();
}

resetTarget();

platform.target

platform.target is a getter on a frozen object. Every access reads the currently configured target.
import { platform } from "@qawolf/flows";

const target = platform.target;
Example with setup:
import { configureTarget, platform } from "@qawolf/flows";
import type { Target } from "@qawolf/flows";

declare const target: Target;

configureTarget({ target });

console.log(platform.target);
Current behavior from the implementation:
  • it throws if no target has been configured
  • it always reflects the latest value set through configureTarget(...)

configureTarget(...)

Use this to set the active target in local execution or tests.
import { configureTarget } from "@qawolf/flows";
import type { Target } from "@qawolf/flows";

declare const target: Target;

configureTarget({ target });
The input shape is:
type TargetScope = {
  target: Target;
};

getCurrentScope()

Returns the current configured target scope, or undefined when no target has been configured yet. Example:
import { getCurrentScope } from "@qawolf/flows";

const scope = getCurrentScope();

if (scope) {
  console.log(scope.target);
}

resetTarget()

Clears the configured target scope. Use this in tests to avoid leaking target state across cases. Example:
import { configureTarget, getCurrentScope, resetTarget } from "@qawolf/flows";
import type { Target } from "@qawolf/flows";

declare const target: Target;

configureTarget({ target });
resetTarget();

console.log(getCurrentScope()); // undefined

FailWithoutRetryError

This is a dedicated error class whose message is "failWithoutRetry". Use it when flow execution should fail immediately rather than being treated as retryable by the surrounding runtime. Example:
import { FailWithoutRetryError } from "@qawolf/flows";

throw new FailWithoutRetryError();
Last modified on April 24, 2026