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

CSV Parser and CSV Creator: Import and Export CSV in Workflows

FlowMattic CSV Parser and CSV Creator: a supplier's CSV price list is parsed into rows and an Iterator updates each product, while CSV Creator exports data back to a CSV file.

FlowMattic’s CSV Parser reads a CSV file from a URL and hands every row to your workflow as JSON. Its partner, CSV Creator, does the reverse: it writes a CSV file from table data, JSON or an array and saves it to the WordPress Media Library. Together they cover CSV imports and exports without a spreadsheet in the loop.

This is for store owners syncing supplier price lists, agencies sending clients weekly exports, and anyone who still receives data as a .csv. Below you will find every field of both modules, the output they return, real use cases, and the parsing rules that decide whether a file imports cleanly.

What are the CSV Parser and CSV Creator?

Both are built-in action modules listed under Utilities in the step picker, with the rest of the data tools. They run on your own WordPress server.

  • CSV Parser by FlowMattic (“Read rows and columns out of a CSV file”) has one action, Parse CSV File, which parses any CSV file URL into JSON data.
  • CSV Creator (“Build a CSV file from workflow data”) has three actions: Create CSV from FlowMattic Table, Create CSV from JSON and Create CSV from Array.

How the CSV parser works

  1. Add a trigger, such as a Schedule for a feed you import daily or a webhook that sends a file URL.
  2. Add a step, choose CSV Parser by FlowMattic and pick Parse CSV File.
  3. Enter or map the CSV File URL. It must be publicly accessible.
  4. Set Header Row to Yes if the first row holds column names, or No if it doesn’t.
  5. Test the step, then loop over the rows with an Iterator.
FlowMattic workflow builder showing the CSV Parser by FlowMattic step with the Parse CSV File action, the CSV File URL field and the Header Row option.
A CSV Parser step set to Parse CSV File, with the file URL and Header Row set to Yes.

The step returns status, data and records_count. With Header Row set to Yes, data is a JSON list of objects keyed by column name:

CSV:
sku,name,price
A1,Travel mug,12.50
B2,Desk lamp,39.00

data:
[{"sku":"A1","name":"Travel mug","price":"12.50"},
 {"sku":"B2","name":"Desk lamp","price":"39.00"}]

With Header Row set to No, each row is a plain list of values instead, such as ["A1","Travel mug","12.50"], and the first line is treated as data.

How CSV Creator builds a file

Each CSV Creator action ends the same way: it writes the file, adds it to the Media Library and returns file_url, file_name, file_size, file_size_formatted, record_count and attachment_id. Column headers come from the keys of the first row, and nested values are written as JSON text.

FieldUsed byWhat it does
DatabaseFrom FlowMattic TableLocal, or a database connection added in WP Tables
TableFrom FlowMattic TableThe table to export
Record SelectionFrom FlowMattic TableAll Records, Last X Records, First X Records, or Custom Query (WHERE clause)
Number of RecordsFirst X and Last XHow many rows to include, ordered by ID
WHERE ConditionCustom QueryA condition without the WHERE keyword, such as status = 'active'
Limit Records, Sort OrderCustom QueryOptional cap on rows, and ascending or descending order by ID
JSON DataFrom JSONA list of objects; a single object becomes one row
Array DataFrom ArrayArray data from earlier steps, in JSON or array form
File NameAllOptional; .csv is added if missing. Empty means FlowMattic-csv-YYYY-MM-DD-HH-MM-SS.csv
DelimiterAllComma, Semicolon, Tab, Pipe or Colon
Include HeadersAllYes writes column names as the first row

The WHERE Condition also understands date shortcuts, so created_at >= 7_DAYS_AGO or created_at >= 1_MONTH_AGO always means relative to the run. Use any number with DAYS, MONTHS or YEARS.

FlowMattic workflow builder showing the CSV Creator step with the Create CSV from FlowMattic Table action, its Database, Table, Record Selection, Delimiter and Include Headers fields.
CSV Creator exporting the last 50 records of a WP Tables table, with delimiter and header options.

Use cases

Update prices from a supplier’s CSV

A supplier publishes a price list at a fixed URL. Parse it each morning and update the matching product for every row.

Flow: Schedule (Every Day) → Parse CSV File → Iterator → WooCommerce (update product)

Import a published spreadsheet

A team keeps a list in a spreadsheet app that can publish a sheet as a CSV link. Parse that link on a schedule and add each row to a WP Tables table on your site.

Flow: Schedule → Parse CSV File → Iterator → WP Tables (New Record)

Email a client last week’s leads

An agency stores form leads in WP Tables. Every Monday, export the last seven days with created_at >= 7_DAYS_AGO and attach the file to the client’s report email.

Flow: Schedule (Every Week) → Create CSV from FlowMattic Table → Send Email (Attachments)

Hand an API response to the finance team

A SaaS billing API returns a JSON list of invoices. Turn it into a semicolon-separated CSV that opens cleanly in European spreadsheet settings.

Flow: Schedule (Every Month) → API Request (GET) → Create CSV from JSON → Send Email

Deliver a nightly file to a partner’s server

A fulfilment partner collects orders as a pipe-delimited file from their FTP server. Build the file from your order table and upload it.

Flow: Schedule (Every Day) → Create CSV from FlowMattic Table → FTP (Upload a file)

Let an AI agent review an uploaded list

Support receives a CSV of order numbers by email. Import the attachment, parse it, and give the rows to an AI agent that drafts a summary of what needs attention.

Flow: Email with Attachment → Import Email Attachments to Media Library → Parse CSV File → AI Agent → Send Email

Tips and gotchas

Reading CSV files

  • Set Header Row on purpose. Only an explicit Yes turns the first row into keys, so check the setting after you pick the action.
  • Keep each record on one line. The file is split into rows at every line break, so a quoted cell that contains a line break splits its record. Rows whose column count doesn’t match the header row are skipped.
  • Header names are cleaned. Anything other than letters, numbers, underscores, hyphens and spaces is removed, so Price (£) becomes Price with a trailing space.
  • Count the rows in data if you need an exact number. records_count counts the lines read after the header, and a blank last line counts too.
  • The URL must answer with 200. Any other status returns an error with the response_code, which helps when a link has expired or needs a login.
  • Loop with an Iterator. data is a JSON string, which the Iterator’s Loop Through Array action accepts directly.

Writing CSV files

  • Files are public by URL. The file goes into the Media Library like any upload, so anyone with the link can download it. Think twice before exporting personal data, and remove old exports you no longer need.
  • A fixed file name is reused. CSV Creator writes to that name each run, replacing the earlier file, and adds a new Media Library entry each time. Leave File Name empty, or include a date, to keep every export.
  • Date shortcuts use UTC. 7_DAYS_AGO is calculated from the current UTC time.
  • An empty result is an error. If the selection matches no rows, the step returns “No records found in the table” instead of an empty file.
  • Headers come from the first row. If later rows have extra keys, those values are still written, but without a matching header.

Related features

  • Iterator: run the next steps once for each parsed row.
  • WP Tables: store imported rows, and export them again with CSV Creator.
  • JSON Parser: reshape rows before you export them.

FAQ

How do I import a CSV file into a WordPress workflow?

Add a step with the Parse CSV File action, enter the file’s public URL and set Header Row. The rows come back as JSON in data, and an Iterator runs your next steps once per row.

Can FlowMattic export a table to CSV automatically?

Yes. Use CSV Creator’s Create CSV from FlowMattic Table with a Schedule trigger. Choose all records, the first or last X, or a WHERE condition, and the file lands in the Media Library with its URL in file_url.

Can I change the CSV delimiter?

CSV Creator lets you pick Comma, Semicolon, Tab, Pipe or Colon. Parse CSV File reads comma-separated files.

Why are some rows missing after parsing?

Rows whose number of columns differs from the header row are skipped, and so are rows broken apart by a line break inside a quoted cell. Check the source file for multi-line cells and stray delimiters.

Both CSV modules ship with FlowMattic and run on your own server, next to nearly 900 integrations. See the plans and automate your next import or export.

More from the blog