Workflows as codeAPI referenceFunction: applyEvent()On this pageFunction: applyEvent() applyEvent(state, event): RunState Apply one event to state (mutated and returned). Throws HistoryStateError when the event cannot follow the history so far. Parameters state RunState event RunEventRecord Returns RunState