Writes JSON state to a file.
InputStateKey has the key that should be persisted. Can be null to persist entire state.
{}