This is more or less same topic as here:
The workflow did work in the past and all of sudden there is an error:
Error in task. Object reference not set to an instance of an object
The content list called Forms has got following users:
Members (contribution rights)
Secretary (approval rights)
The Workflow Task has got Secretary (approval rights).
Secretary must have contribute permissions.
To me, that error seems like whatever variable is being used in the flexi task isn't proper. Try logging the variables used into the workflow history and check the values, make sure they are correct. Do all of the workflows being ran produce the error or is it only certain ones?
The secretary has got approval rights which included the contribution rights as far as I know. In mean time, I have removed a variable REF which was a text field and was used in reference to make it look as Ref: current date - ID.
Now I have removed the variable and one of the user's is getting this error when workflow is run;
Failed to send notification. The specified string is not in the form required for an e-mail address.
I have an email notification to : Request (also tried with initiator).
The Request is a group/people field which automatically fills in the user name via Current User reference.
the error to me indicates that the user's email address is not a right format!!
But the fact is that I created the user and the email is the right format ...
Yes, anybody ran into the same error.
Removed the variable and also added the Members as READ to Workflow Task - which works for now.
But now another error is appearing, see above.
Add this before the action that is erring.
Within it, add the variables you want to test.
When you run the workflow, click on the item that is running it - the ... and click Workflows. This will open a window that shows all workflows that have run on that item. Click the latest workflow that is running. Within that will show the log to history and you'll see the values of the variables you put in the action.
It will look something like this
Yes, done that and it logs the domain/username.
I am suspecting that the new user's data has not been replicated to sharepoint as yet.
It works fine with other user accounts.
Unsure though what caused the very initial problem? I am suspecting either it was the Variable (which I doubt) or because the Members had no Read permission to the Workflow Task.
Are you using on prem sharepoint? If the user is a new user, SharePoint's UserProfileService can take awhile for it to sync with AD and into SP. All depends on the settings your SP Admin has put in place for it.