Expand my Community achievements bar.

Triggering an event to perform an action ,that will append a file at sFTP after 5 min

Avatar

Level 3

"I need to create a custom event that triggers every 5 seconds and performs an action to append a file to an SFTP server. I'm not sure about the workflow. How can I create a custom event that will call my append-action file every time? What steps are needed for this?"

4 Replies

Avatar

Employee
Employee

Hi @ShubhamAg2 - I think you don't need custom events. You just need to run an action on a corn schedule. To see how visit -  https://developer.adobe.com/app-builder/docs/resources/cron-jobs/ 

 

Avatar

Level 3

I added this code to the app. config.yaml

 

append-file-sFTP:
function: actions/append-file-sFTP/index.js
web: 'yes'
runtime: nodejs:18
inputs:
LOG_LEVEL: debug
apiKey: $SERVICE_API_KEY
providerId: ""
eventCode: com.adobe.appenddata
client_id: ""
client_secret: ""
technical_account_email: ""
technical_account_id: ""
ims_org_id: ""
annotations:
require-adobe-auth: false
final: true
event-consumer:
function: actions/event-consumer/index.js
web: 'no'
runtime: nodejs:18
inputs:
LOG_LEVEL: debug
annotations:
require-adobe-auth: false
final: true
Triggers:
everyMin:
feed: /whisk.system/alarms/interval
inputs:
minutes: 1
rules:
everyMinRule:
trigger: everyMin
action: append-file-sFTP
 
"When I invoke the action via the web, it appends the file on the SFTP, but it does not trigger the event every minute. How can I verify that the trigger is invoking the action?"