How to speed up user feedback after pressing button that triggers workflow?

Hi everyone.
My app has a button with a workflow that creates a new database entry saving the user who pressed the button and the group that the button is in. The button then has conditional that does a search for entries containing the user and the group and if one exists, inactivates the button and changes the text and button color. This works fine, however it takes a second or two to change the color and text of the button, which makes for a really slow and lousy user experience. Does anyone know of a way that I can speed this up or make the button change before the database entry part of the workflow?

A method that I use that might help you out here is the do the following:

  1. Create a custom state on the button called “btn_msg” and leave the default empty
  2. Add a condition on the button “when button’s btn_msg is not empty” and then change the text of the button to use the btn_msg custom state and this button is inactive
  3. In the workflow that is triggered on button click, the first step should be setting the custom state of the button. If the button text says “Save”, set the custom state to “Saving”, or something like that. That was just an example.
  4. Add the rest of the steps to your workflow and then add a last step that clears the custom state.

Using this method, the button would show something is happening almost instantaneous. Let me know if you have any questions.