def set_flow_run_state(self, flow_run_id: str, state: 'prefect.engine.state.State', version: int=None) -> 'prefect.engine.state.State':
    '\n        Sets new state for a flow run in the database.\n\n        Args:\n            - flow_run_id (str): the id of the flow run to set state for\n            - state (State): the new state for this flow run\n            - version (int, optional): the current version of the flow run state. This is optional\n                but it can be supplied to enforce version-locking.\n\n        Returns:\n            - State: the state the current flow run should be considered in\n\n        Raises:\n            - ClientError: if the GraphQL mutation is bad for any reason\n        '
    mutation = {'mutation($input: set_flow_run_states_input!)': {'set_flow_run_states(input: $input)': {'states': {'id', 'status', 'message'}}}}
    serialized_state = state.serialize()
    result = self.graphql(mutation, variables=dict(input=dict(states=[dict(state=serialized_state, flow_run_id=flow_run_id, version=version)])))
    state_payload = result.data.set_flow_run_states.states[0]
    if (state_payload.status == 'QUEUED'):
        return prefect.engine.state.Queued(message=state_payload.get('message'), start_time=pendulum.now('UTC').add(seconds=prefect.context.config.cloud.queue_interval))
    return state
Sets new state for a flow run in the database.

Args:
    - flow_run_id (str): the id of the flow run to set state for
    - state (State): the new state for this flow run
    - version (int, optional): the current version of the flow run state. This is optional
        but it can be supplied to enforce version-locking.

Returns:
    - State: the state the current flow run should be considered in

Raises:
    - ClientError: if the GraphQL mutation is bad for any reason
def set_flow_run_state(self, flow_run_id: str, state: 'prefect.engine.state.State', version: int=None) -> 'prefect.engine.state.State':
    '\n        Sets new state for a flow run in the database.\n\n        Args:\n            - flow_run_id (str): the id of the flow run to set state for\n            - state (State): the new state for this flow run\n            - version (int, optional): the current version of the flow run state. This is optional\n                but it can be supplied to enforce version-locking.\n\n        Returns:\n            - State: the state the current flow run should be considered in\n\n        Raises:\n            - ClientError: if the GraphQL mutation is bad for any reason\n        '
    mutation = {'mutation($input: set_flow_run_states_input!)': {'set_flow_run_states(input: $input)': {'states': {'id', 'status', 'message'}}}}
    serialized_state = state.serialize()
    result = self.graphql(mutation, variables=dict(input=dict(states=[dict(state=serialized_state, flow_run_id=flow_run_id, version=version)])))
    state_payload = result.data.set_flow_run_states.states[0]
    if (state_payload.status == 'QUEUED'):
        return prefect.engine.state.Queued(message=state_payload.get('message'), start_time=pendulum.now('UTC').add(seconds=prefect.context.config.cloud.queue_interval))
    return state