trigger.dynamic.exec

The trigger.dynamic.exec is used to dynamically invoke a trigger on-demand and is identified by a key. If multiple instances with the same key are used then it will fire independently. It accepts a key and an input. The input is either a string or an object. For examples on trigger.dynamic.exec, see array.iterator action and object.iterator action.

The trigger you are trying to execute using the trigger.dynamic.exec must have a trigger.result action

TR50 Request
{  
   "1":{  
      "command":"trigger.dynamic.exec",
      "params":{  
	 "key": "dynamic_test", 
	 "encoding":"string",
	 "input":{"test":"abc123"}, 
	 "timeout":5000
      }
   }
}

Request Parameters

Name Type Required Description
key String Yes The key of the trigger.dynamic.exec event
encoding   Yes The type of encoding used, it is either string or object.
input String or JSON The input must be a string or a JSON object. If invoked with a string, then $(event.input) will be a simple string value, if JSON is passed to the input, then it will be an object. If an object, then JSON like {"value":10} will be accessed as $(event.input.value).
timeout Integer   If specified, the trigger will wait for the specified timeout (in milliseconds) for the trigger to complete.

If the command is sent successfully a success message and the result is returned. The results will come in the value parameter of the reply. The reply will always be a JSON sub-document, and will vary based on the configuration of the associated cloud trigger that invoked. Otherwise, an error and error message will be returned.

TR50 Response
{
  "cmd": {
    "success": true,
	"params": {
	"value": "\"abc123\""
	}
  }
}

Related topics