I periodically run into an issue when working with Nintex Workflow for Office 365. When I go to Save or Publish a workflow, I get the following error message:
Error publishing workflow. Invalid JWT token. The token is expired.
I found a solution that has been working for me. Keep the workflow you are trying to save or publish open. Open up another browser tab or window, then open up a new workflow on the same site in designer mode. Once you’ve done that, go back to the original workflow and try to save or publish it again, which you should now be able to do.