Workflow will not start. The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service.

Problem:

A work­flow that is cre­at­ed with Share­Point Design­er can­not be start­ed.
The fol­low­ing error appears:

Error: The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.

Reason:

The startscreen for the work­flow, which is actu­al­ly an InfoPath form, can­not be dis­played. This is because the State Ser­vice is not installed or is not active.

Resloution:

Start a Share­Point 2013 Man­age­ment Shell ses­sion and enter these com­mands to set­up a State Ser­vice.
$ss = New-SPStateServiceApplication -Name "State Service"
New-SPStateServiceDatabase -Name "WSS_StateService" -ServiceApplication $ss
New-SPStateServiceApplicationProxy -Name "State Service Proxy" -ServiceApplication $ss –DefaultProxyGroup