Join us online for the Google Smart Home Developer Summit on October 21st! Register here to learn what's new, and what's coming up for Google Smart Home.

Callback registered with the App via App.onExecute to process requests to update device state.

To support local fulfillment, the local home platform must first establish a local fulfillment path. For more details, see the developer guide.

const executeHandler = (request: IntentFlow.ExecuteRequest):
  Promise<IntentFlow.ExecuteResponse> => {

    // Extract command(s) and device target(s) from request
    const command = request.inputs[0].payload.commands[0];
    const execution = command.execution[0];

    const response = new Execute.Response.Builder()

    const result = => {
      // Construct a local device command
      const deviceCommand = new DataFlow.TcpRequestData();
      // ...

      // Send command to the local device
      return localHomeApp.getDeviceManager()
        .then((result) => {
          response.setSuccessState(result.deviceId, state);
        .catch((err: IntentFlow.HandlerError) => {
          err.errorCode = err.errorCode || "invalid_request";
          response.setErrorState(, err.errorCode);

    // Respond once all commands complete
    return Promise.all(result)
      .then(() =>;