Skip to content

Instantly share code, notes, and snippets.

@evancohen
Created February 17, 2020 07:01
Show Gist options
  • Save evancohen/8afb86cf7cedcb21df48df046710907a to your computer and use it in GitHub Desktop.
Save evancohen/8afb86cf7cedcb21df48df046710907a to your computer and use it in GitHub Desktop.
(async () => {
try{
// Get the list of processes
const processes = await UiPathRobot.getProcesses()
// Find a specific process by ID
const sample = processes.find(p => p.id == "c9973f8d-a46b-41cd-8436-f411cdba3355")
// Start the process (creates a job)
const job = sample.start({ NumberToAdd: 0 })
// When the job status changes, log it to the console
job.onStatus(status => {console.log(`Status: ${status}`)})
// After the job completes log process results to the console
const results = await job
console.log(results)
} catch(e) {
// Handle any errors
console.error(e)
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment