Thousands of public hospital workers will strike across NSW as they fight for increased security in their workplaces.

More than 20,000 workers will walk off the job on Thursday over workplace safety concerns after a vote by Health Services Union delegates in July.

The union said the rolling four-hour strike will go ahead despite the Department of Health on Wednesday saying an agreement had been reached at the Industrial Relations Commission to avert the action.