You are viewing beta documentation for Formie 4.x. View the latest stable version (3.x) →
Developers

Console Commands

Formie comes with a number of command line utilities that can be run on-demand, or on a set schedule.

Forms

Re-Save Forms

Refer to the Craft docs (opens new window) on available options.

./craft resave/formie-forms --update-search-index=1

Delete Forms

You can bulk delete forms with this command.

OptionDescription
--form-handleThe form handle(s) to delete. Can be set to multiple comma-separated handles.
--form-idThe form ID(s) to delete. Can be set to multiple comma-separated IDs.
./craft formie/forms/delete --form-handle=form1,anotherForm

Import/Export

List Forms

Lists all available Formie forms that can be exported or imported.

OptionDescription
folderPathOptional path to look for JSON files. Defaults to the plugin's export folder.
./craft formie/forms/list

Export Forms

Export Formie forms as JSON files. Requires form IDs or handles as a comma-separated list.

./craft formie/forms/export 1,contact-form,newsletter

Import Form

Import a Formie form from a JSON file.

OptionDescription
fileLocationPath to a JSON file to import. Can be relative to the plugin's export folder or an absolute path.
--createWhether to create a new form instead of updating an existing one. Default is false.
./craft formie/forms/import formie-contact-form.json

Import All Forms

Import all Formie form JSON files from a folder.

OptionDescription
folderPathOptional path to look for JSON files. Defaults to the plugin's export folder.
--createWhether to create new forms instead of updating existing ones. Default is false.
./craft formie/forms/import-all

Submissions

Re-Save Submissions

Refer to the Craft docs (opens new window) on available options.

./craft resave/formie-submissions --form-id=1234 --update-search-index=1

Run Integrations

For a provided submission, run the provided integration.

OptionDescription
--submission-idThe submission ID(s) to use data for. Can be set to multiple comma-separated IDs.
--integrationThe handle of the integration to trigger.
./craft formie/submissions/run-integration --submission-id=12345 --integration=mailchimp

Send Email Notification

For a provided submission, send the provided notification.

OptionDescription
--submission-idThe submission ID(s) to use data for. Can be set to multiple comma-separated IDs.
--notification-idThe ID of the notification to trigger.
./craft formie/submissions/send-notification --submission-id=12345 --notification-id=12

Cron

Run Scheduled Tasks

Runs Formie tasks that should be scheduled on cron: interrupted submission delivery recovery, cleanup/retention and due scheduled reports.

Schedule this command on production sites — for example, hourly:

./craft formie/cron/run
OptionDescription
--skip-gcSkip cleanup and retention tasks.
--skip-reportsSkip scheduled report delivery.
--skip-deliveriesSkip interrupted submission delivery recovery.
--onlyComma-separated task groups to run: gc, reports, deliveries.

Use --only or the skip flags when you want separate cron schedules — for example, daily cleanup and hourly reports:

# Daily cleanup at 3am
0 3 * * * /path/to/craft formie/cron/run --only=gc

# Hourly scheduled reports
0 * * * * /path/to/craft formie/cron/run --only=reports

Craft's garbage collection (opens new window) still runs Formie cleanup as a best-effort fallback on web requests, but production sites should not rely on it.

Recover Interrupted Submission Delivery

Run ./craft formie/deliveries/recover to schedule up to 100 committed but unscheduled submission dispatches. Use --limit to change the batch size, up to 500. This is also included in formie/cron/run, or can run separately with --only=deliveries. Run it frequently enough for your delivery requirements and keep Craft's queue workers running.

Recovery resumes Dispatch only; it does not submit the form again or charge a payment again. Queue publication happens after completion commits. Lost or interrupted scheduling can be republished after ten minutes, and duplicate recovery jobs share the original run identity. Unknown provider outcomes still require reconciliation.

./craft formie/deliveries lists run identities and statuses without submission content or credentials. A submission_changed failure means unscheduled delivery could no longer use the accepted submission version; inspect it before starting a deliberate new delivery. Recovery does not silently send edited content under the old identity.

Reports

Run Scheduled Reports

Sends any enabled scheduled reports that are due. This is included in ./craft formie/cron/run, or you can schedule it separately — for example, every hour — so scheduled report deliveries run automatically.

./craft formie/reports/run-scheduled

Cleanup

Run All Cleanup Tasks

Runs every Formie cleanup and retention task. This is included in ./craft formie/cron/run, or you can schedule it separately — for example, daily:

./craft formie/gc/run
OptionDescription
--onlyComma-separated cleanup task handles. Omit to run all tasks. Handles: incomplete-submissions, data-retention-submissions, sent-notifications, file-upload-asset-retention, stale-pending-uploads, report-exports, submission-grants, submission-progress, submission-operations.

Prune Incomplete Submissions

Deletes any incomplete submissions that exceed the "Maximum Incomplete Submission Age" plugin setting.

./craft formie/gc/prune-incomplete-submissions

Prune Data Retention Submissions

Deletes any submissions that exceed your data retention form settings.

./craft formie/gc/prune-data-retention-submissions

Prune Sent Notifications

Deletes sent notifications that exceed the plugin's maximum age setting.

./craft formie/gc/prune-sent-notifications

Prune Submission Grants

Deletes expired purpose-bound submission grants.

./craft formie/gc/prune-submission-grants

Prune Submission Progress

Deletes expired canonical submission progress rows.

./craft formie/gc/prune-submission-progress

Prune File Upload Asset Retention

Deletes uploaded assets that exceed a File Upload field's asset retention setting while keeping the submission record.

./craft formie/gc/prune-file-upload-asset-retention

Prune Stale Pending Uploads

Deletes unfinalized staged File Upload assets that exceed the plugin's maximum incomplete submission age.

./craft formie/gc/prune-stale-pending-uploads

Prune Report Exports

Deletes expired report export files.

./craft formie/gc/prune-report-exports

Delete Submissions

You can bulk delete submissions with this command.

OptionDescription
--form-handleThe form handle(s) to delete submissions from. Can be set to multiple comma-separated handles.
--form-idThe form ID(s) to delete submissions from. Can be set to multiple comma-separated IDs.
--incomplete-onlyWhether to delete only incomplete submissions.
--spam-onlyWhether to delete only spam submissions.
--beforeDelete submissions created before a date or relative date string.
--afterDelete submissions created after a date or relative date string.
./craft formie/submissions/delete --form-handle=form1,anotherForm

Delete Sent Notifications

You can bulk delete sent notifications with this command.

OptionDescription
--form-handleThe form handle(s) to delete sent notifications for. Can be set to multiple comma-separated handles.
--form-idThe form ID(s) to delete sent notifications for. Can be set to multiple comma-separated IDs.
--allDelete sent notifications for all forms.
--hard-deletePermanently delete sent notifications instead of soft deleting them.
./craft formie/sent-notifications/delete --form-handle=form1,anotherForm

Migration

You can run the migrations from either Sprout Forms or Freeform via the command line. This is useful if you have a large number of submissions or complex forms to migrate.

Migrate Sprout Forms

OptionDescription
--form-handleThe Sprout Forms handle(s) to migrate. Can be set to multiple comma-separated handles. Omit to migrate all.
./craft formie/migrate/sprout-forms --form-handle=form1,anotherForm

Migrate Freeform

OptionDescription
--form-handleThe Freeform form handle(s) to migrate. Can be set to multiple comma-separated handles. Omit to migrate all.
./craft formie/migrate/freeform4 --form-handle=form1,anotherForm
./craft formie/migrate/freeform5 --form-handle=form1,anotherForm

Recover Payments

Run these commands from your Craft project’s root directory when a payment remains unresolved after a timeout or interrupted request. A pending payment may already have charged the customer. Formie keeps its saved amount, gateway account and references so retrying the submission can’t silently create another purchase.

Moneris, Eway, BPOINT, Opayo, Mollie and Paddle use this recovery flow. To list up to 100 unresolved payments, then inspect one payment in detail:

./craft formie/payments
./craft formie/payments/inspect 123

Replace 123 with the local payment ID. The output includes the submission and integration IDs, amount, currency, gateway reference and merchant reference. For another page of results, pass the last payment ID and a limit: ./craft formie/payments/index 123 100.

An upgraded historical payment or subscription may have no verifiable account fingerprint. Do not assume it belongs to the currently configured merchant account. After independently finding the original provider resource and checking that the integration connects to that same account, use ./craft formie/payments/verify-account payment 123 "How the original account was verified" --confirmed, or substitute subscription. This records the account binding and an audit note only; it cannot replace an existing binding, change the amount, settle the payment or send a provider request. Ordinary status lookups and cancellation remain blocked until historical ownership is verified.

Check the Gateway

Try a status lookup before making a manual decision:

./craft formie/payments/reconcile 123

This uses the integration’s transaction lookup where one is available. Eway can also find a payment by its unique invoice reference when the creation response was lost. Mollie can restore a missing reference from a webhook after verifying its transaction, saved owner and amount. A missing or unverified lookup result keeps the payment unresolved.

If automatic lookup is unavailable, use the merchant reference to find the transaction in the original gateway account. Check the amount, currency and final transaction status. For a hosted checkout, confirm that it has completed or has been cancelled before deciding whether the customer can retry.

Record a Verified Outcome

When you have independently verified a successful charge, record the gateway reference and a note identifying who checked it and the evidence used:

./craft formie/payments/resolve 123 success 25.00 USD "gateway-reference" "Checked by Alex in the gateway dashboard; amount and receipt match."

The command checks the amount and currency against the saved payment, rejects a conflicting reference and asks you to confirm the outcome. It saves your note with the payment. It does not create a charge or resume submission processing.

Earlier attempts may not have a saved gateway account record. Repeated submissions keep these attempts unresolved. Verify the original gateway account as well as the transaction before recording an outcome, and include that account verification in your note. The command does not infer the original account from the integration’s current credentials.

If the gateway confirms that no charge occurred, and any open checkout or authorisation can no longer complete, record a failed outcome to permit a fresh attempt:

./craft formie/payments/resolve 123 failed 25.00 USD "" "Checked by Alex; gateway confirms no charge and no open checkout."

Use the saved gateway reference in place of "" if the payment already has one. A timeout or an empty search result alone is insufficient evidence of failure. Confirmed command-line automation can pass --confirmed=1 --interactive=0 after performing the same checks.

Resume a Successful Submission

After verifying a successful payment, resume the submission’s remaining processing:

./craft formie/payments/resume 123

This can run the form’s configured notifications and integrations. Formie reuses its saved workflow state to avoid repeating completed delivery steps. If processing fails, the payment remains successful; resolve the reported processing error before running the command again.

The saved payment must match the submission’s current amount and currency. If the submission or payment settings changed while checkout was pending, review the difference before resuming. The original successful charge remains recorded, and a mismatch keeps the submission incomplete without creating another charge.

Webhook Receipts

./craft formie/payments/receipts 0 100 lists up to 100 receipts after the supplied ID, including state history, attempts, safe errors and the escaped redacted display projection. It never decrypts raw provider payloads. ./craft formie/payments/evidence 123 explicitly exports the exact decrypted body, verification headers and normalized payload for receipt 123 to standard output; use it only in a trusted terminal and handle the output as private provider/customer data.

Receipts progress through verified, scheduled, processing and processed states. Handling failures are rescheduled with bounded backoff; a receipt becomes failed after exhausting automatic attempts. Retries reuse the same receipt and completed receipts do not rerun side effects. ./craft formie/payments/recover-webhooks 100 schedules up to 100 due or interrupted receipts when queue publication or a worker was interrupted. Financial rows and encrypted webhook evidence have indefinite retention; automatic cleanup only removes expired payment capabilities after a one-day grace period. Payment and subscription histories keep the most recent 100 transitions. Preserve the Formie security key with backups. A processed receipt may still require payment/submission reconciliation after an interrupted completion commit; inspect the payment's version, history and submission-transition receipt before resuming it.

A payment in unknown must be reconciled against its original account and immutable amount. Automatic lookup is available only when the adapter implements it and has a usable provider reference. Otherwise, use the verified operator resolution flow above. In particular, a lost Opayo challenge response never repeats the challenge automatically. Broader queue/delivery diagnostics are separate from these payment receipts.