Define a Polling Trigger

Learn how to define a simple polling trigger.

  1. In VS Code, click Explorer Explorer icon on the sidebar.
    The directory structure of your workspace folder is displayed.
  2. Within the definitions directory listing, click the adapter definition document that you want to work on.
    The document is displayed in the VS Code editor.
  3. In the triggers section of the document, create a skeleton trigger code.
  4. Set the type property to polling.
  5. Specify the request method.
  6. Specify the request schema.
  7. Specify the execute flow to poll an external service.
  8. Specify the polling configuration in the polling property as follows:
    1. Initialization flow: Specify the flow that's executed once on integration activation.
    2. Success flow: Specify the flow that's executed after each poll if polling is successful and if poll out is accepted by the integration. This flow is used to commit or acknowledge.
    3. Polling frequency: Specify the interval for polling (in seconds).
  9. Add configuration for designtime, if any, in the configuration property.

Here's an example polling trigger definition:

"triggers":{
   

"pollingTypeTrigger": {
  "displayName": "Polling Type Trigger parallel",
  "description": "This trigger Polls.",
  "type": "polling",
  "httpMethod": "POST",
  "execute": "flow:TriggerReceiveMessageFlow",
  "request":  { "schemaType": "application/schema+json", "schema": { "$ref": "#/schemas/pollSchema" } },
  "polling": {
    "onSuccess": "flow:OnSuccessFlow",
    "onInit": "flow:init",
    "pollFrequencyInSeconds": 15
  },
  "configuration": [
    
    {
      "name": "InputField",
      "displayName": "Provide Poll input",
      "description": "Provide Poll input",
      "type": "TEXT_AREA",
      "required": true,
      "validation": "flow:ValidateJsonFlow",
      
    }
      
  ]

}