I found that the State Service is missing in the SharePoint 2013 central administration site. I am not sure it is the problem with my installation.
I need to create a simple Approval workflow in my SharePoint 2013 site and for that first I need to check all services required to run workflows are configured correctly or not. As we all know Workflows should require the State Service to be run in the environment and the service should be associated with the web application where we are creating the workflows.
As there is no UI to start the service in SharePoint 2013, I have used the Powershell script to do this job.
$serviceApp = New-SPStateServiceApplication -Name "State Service"
New-SPStateServiceDatabase -Name "StateServiceDatabase" -ServiceApplication $serviceApp
New-SPStateServiceApplicationProxy -Name "State Service" -ServiceApplication $serviceApp -DefaultProxyGroup
The above 3 lines will create the state service application, state service database and the proxy to run the service. Now, the final step will be associating the service with the current web application. For this, go to
Central Administration -> Application Management -> Service Application Associations. Associate the service with your web application.
Here you go, all is set and enjoy with workflows...