aer
Aer Flow to Apex

aer flow-to-apex

Convert a flow to Apex

Synopsis

Convert a flow to Apex code.

This command reads a Flow metadata file (.flow-meta.xml) and generates equivalent Apex code. The generated code should be reviewed and may require manual adjustments.

Supported flow types:

  • Record-triggered flows: Generates an Apex trigger
  • Scheduled flows: Generates a trigger + Queueable class
  • AutoLaunched flows (sub-flows): Generates an invocable Apex class

Use –output-dir to specify where to write files.

Examples:

aer flow-to-apex src/flows/MyFlow.flow-meta.xml
aer flow-to-apex src/flows/MyFlow.flow-meta.xml -o src/triggers/MyFlow.trigger
aer flow-to-apex src/flows/MyScheduledFlow.flow-meta.xml -d src/
aer flow-to-apex src/flows/MySubflow.flow-meta.xml -d src/
aer flow-to-apex <flow-file> [flags]

Options

  -h, --help                help for flow-to-apex
  -o, --output string       output file for trigger (default: stdout)
  -d, --output-dir string   output directory for multiple files (required for scheduled flows)

Options inherited from parent commands

  -q, --quiet     suppress progress output
  -v, --verbose   enable verbose output

SEE ALSO

  • aer - aer is the Apex Execution Runtime
© 2012–2026 October Swimmer.