Skip to main content

NF-e Retries

The system implements automatic retry for failed issuances.

Automatic Worker

Runs every 30 minutes and performs:

  1. Process retries: Pending or errored NF-e that still have attempts remaining
  2. Update status: Query the provider for NF-e in processing status (last 7 days)
  3. Auto-issue on payment: Issue NF-e for paid invoices (on_full_payment policy)
  4. Auto-issue on finalization: Issue for finalized invoices (on_finalization policy)
  5. Auto-issue per installment: Issue for paid installments (per_installment policy)

Retry Logic

Default Intervals

AttemptIntervalCumulative Time
1stImmediate0 min
2nd+30 min30 min
3rd+60 min1h30
4th+180 min4h30
5th+360 min~10h30

The intervals are configurable per organization via retryDelaysMinutes.

Maximum Attempts

  • Issuance: 5 attempts (configurable via maxIssueAttempts)
  • Cancellation: 5 attempts (configurable via maxCancelAttempts)

After exhausting attempts, the status changes to error.

Error Handling

  • Auto-issuance errors are non-blocking (expected when NF-e is not enabled)
  • Detailed logs for each attempt
  • Process and error counters per worker execution