tr Skip to content
Black Friday FlowMattic for life, 12 payments of $33.25 Or $399 once. Nothing added for splitting Ends in --Days --Hrs --Min --Sec See the deal

Unit Converter Automation: 13 Measurement Types in a Workflow

FlowMattic Unit Converter module: an order weight of 2.5 kg is converted to 5.51 lb and passed to a shipping API step.

Unit converter automation means a workflow changes kilograms to pounds, Fahrenheit to Celsius or bytes to gigabytes on its own, the moment the data arrives. In FlowMattic that is one step: the Unit Converter takes a value, a from unit and a to unit, and returns the converted number for the next step to use.

It suits stores shipping across borders, agencies publishing listings for different markets, and SaaS teams reporting usage in units people read. This guide covers all thirteen conversion types, the exact unit names each one accepts, and the edge cases that trip people up.

What is the Unit Converter?

Unit Converter by FlowMattic is a built-in action module. In the step picker it is listed under Utilities as “Convert between units of measure”, next to the other data tools. It runs on your own WordPress server and needs no external service.

Each measurement type is its own action: Length Conversion, Weight Conversion, Temperature Conversion, Volume Conversion, Area Conversion, Speed Conversion, Pressure Conversion, Energy Conversion, Power Conversion, Data Size Conversion, Angle Conversion, Frequency Conversion and Fuel Economy Conversion.

How unit converter automation works

  1. Add a trigger, such as a WooCommerce order, a form submission or a webhook.
  2. Add a step and choose Unit Converter by FlowMattic.
  3. Pick the conversion action, for example Weight Conversion.
  4. Fill Value with the number to convert. Type it or map it from an earlier step.
  5. Enter From Unit and To Unit. Each action shows its supported units under the fields.
  6. Test the step and map converted_value into the next step.
FlowMattic workflow builder showing the Unit Converter by FlowMattic step with the Weight Conversion action and its Value, From Unit and To Unit fields.
A Unit Converter step set to Weight Conversion, converting a value from kg to lb.

Every successful conversion returns the same fields:

{
  "status": "success",
  "converted_value": 5.511561050459444,
  "from_unit": "kg",
  "to_unit": "lb",
  "original_value": 2.5
}

Each linear conversion goes through one base unit (metres, kilograms, litres, square metres, metres per second, pascals, joules, watts, bytes, degrees or hertz). Temperature and fuel economy use their own formulas, because they aren’t simple ratios.

Supported units by action

Units are case-insensitive and surrounding spaces are ignored, so KG, kg and kg all work. Use either the full name or the short form shown in brackets.

ActionUnits you can enter
Length Conversionmeter (m), kilometer (km), centimeter (cm), millimeter (mm), mile (mi), yard (yd), foot or feet (ft), inch (in), nautical_mile (nm)
Weight Conversionkilogram (kg), gram (g), milligram (mg), pound (lb, lbs), ounce (oz), ton (t), stone (st)
Temperature Conversionc, f, k
Volume Conversionliter (l), milliliter (ml), gallon (gal), quart (qt), pint (pt), cup, fluid_ounce (fl_oz), tablespoon (tbsp), teaspoon (tsp), cubic_meter (m3), cubic_cm (cm3, cc)
Area Conversionsquare_meter (sqm, m2), square_kilometer (km2), square_cm (cm2), square_mm (mm2), square_mile (mi2), square_yard (yd2), square_foot (sqft, ft2), square_inch (in2), acre, hectare (ha)
Speed Conversionmeter_per_second (m/s, mps), kilometer_per_hour (km/h, kmh, kph), mile_per_hour (mph), foot_per_second (ft/s, fps), knot (kn)
Pressure Conversionpascal (pa), kilopascal (kpa), bar, millibar (mbar), atmosphere (atm), psi, torr, mmhg
Energy Conversionjoule (j), kilojoule (kj), calorie (cal), kilocalorie (kcal), watt_hour (wh), kilowatt_hour (kwh), btu, electron_volt (ev)
Power Conversionwatt (w), kilowatt (kw), megawatt (mw), horsepower (hp), metric_horsepower (ps), btu_per_hour (btu/h), foot_pound_per_second (ft_lb/s)
Data Size Conversionbit (b), byte, kilobyte (KB), megabyte (MB), gigabyte (GB), terabyte (TB), petabyte (PB)
Angle Conversiondegree (deg), radian (rad), gradian (grad, gon), arc_minute (arcmin), arc_second (arcsec), turn or revolution (rev)
Frequency Conversionhertz (hz), kilohertz (khz), megahertz (mhz), gigahertz (ghz), rpm, bpm
Fuel Economy Conversionmpg, km/l, l/100km

Use cases

Send pounds to a US shipping API

Your catalogue stores weights in kilograms, but the carrier wants pounds. Convert the order weight before the label request goes out, so nobody re-keys it.

Flow: WooCommerce new order → Weight Conversion (kg to lb) → API Request (POST)

Publish property sizes in both units

A real estate agency receives listings in square feet and publishes for buyers who think in square metres. One step adds the second figure to the record.

Flow: Form submission → Area Conversion (sqft to sqm) → WP Tables (New Record)

Alert on sensor readings in Celsius

A device posts temperatures in Fahrenheit to a webhook. Convert to Celsius, then let a Filter stop the run unless the reading is above your limit.

Flow: Webhook (Capture Webhook Response) → Temperature Conversion (f to c) → Filter → Send Email

Report SaaS storage in gigabytes

Usage APIs usually report bytes. Convert to GB and round to two decimals before the monthly usage email goes to each customer.

Flow: Schedule → API Request (GET) → Data Size Conversion (byte to GB) → Number Formatter (Decimal Converter) → Send Email

Log fleet trips in metric and imperial

An operations team with drivers in two countries can store each trip in both systems. Chain two conversions in one run.

Flow: Webhook → Length Conversion (km to mi) → Fuel Economy Conversion (l/100km to mpg) → WP Tables (New Record)

Answer measurement questions with an AI agent

A customer asks whether a 32-inch item fits an 80 cm shelf. An AI agent can pull out the number and unit, and the converter does the arithmetic exactly, so the reply doesn’t rely on the model’s maths.

Flow: Email received → AI Agent → Length Conversion (in to cm) → Send Email

Tips and gotchas

  • Use c, f and k for temperature. The single letters convert correctly. Full names such as celsius return “Invalid from unit specified.”, so stick to the letters.
  • Zero is rejected. A value of 0 returns “Value field is required and must be numeric.” If 0 °C or 0 kg can occur, branch around the step or do that one conversion with the Maths module, for example (0 * 9 / 5) + 32.
  • Send a plain number. 1,200 and 5 kg aren’t numeric, so the step returns the same message. Strip commas and units first with the Text Formatter.
  • Results aren’t rounded. 10 km returns 6.2137119223733395 miles. Add a Decimal Converter step from the Number Formatter for display.
  • Know which standard applies. Gallon, quart, pint, cup and fluid ounce are US measures, and mpg uses the US gallon. Ton (t) is the metric tonne of 1,000 kg.
  • Watch the short forms. In Length Conversion, nm means nautical mile, not nanometre. In Data Size Conversion, b means bit, not byte, and kilobytes are 1,024 bytes.
  • An invalid unit fails the step. The step returns status error with “Invalid unit specified.”, which marks the run as failed in Task History unless the step’s Ignore Errors setting is on.

Related features

  • Number Formatter: round, group and format the converted value for display.
  • Maths: write your own formula when a conversion isn’t on the list.
  • Text Formatter: pull a clean number out of text such as “5 kg”.

FAQ

Can a WordPress workflow convert kilograms to pounds automatically?

Yes. Add a Unit Converter step with Weight Conversion, map the weight into Value, and set From Unit to kg and To Unit to lb. The result is in converted_value.

How do I convert Fahrenheit to Celsius in FlowMattic?

Use Temperature Conversion with From Unit f and To Unit c. 98.6 becomes 37. Negative values work too, but a value of exactly 0 is rejected, so handle that case separately.

Does the Unit Converter use 1,000 or 1,024 for kilobytes?

It uses 1,024. A kilobyte is 1,024 bytes, a megabyte is 1,048,576 bytes, and so on up to petabytes. 1,536 MB converts to 1.5 GB.

Can the units come from an earlier step?

Yes. Value, From Unit and To Unit all accept dynamic tags. That lets one step convert whatever unit a form or an API sent, as long as it matches a name the action supports.

Unit converter automation is one of many data steps that ship with FlowMattic and run on your own site. Try FlowMattic and convert your first value in a few minutes.

More from the blog