Auto generate Invoices via API or Workflow

Yes, I am trying to automate invoicing as well. It would be a workflow that is as simple as when a deal enters “Ready to Invoice” stage the action would be “convert deal to invoice”