Working example adding a card to a workflow

Hello

After a booking request is completed, I am using velo to send a triggered email
triggeredEmails . emailContact ( emailId , userId ,{ variables : { subscriberName : first , bookingId : bookingId } });

I would like to replace this with adding a card to a workflow.

I believe I can get the workflow id from looking at the URL when I view the workflow, but not sure how to get the step id.

Lately, it isn’t clear how to add the velo code.

Fumbled through it - ended up putting this in the backend

import { workflows } from ‘wix-crm-backend’ ;

// create a card and add it to the corresponding workflow phase
export function createCard ( workflowId , phaseId , contactId , firstName , position ){
let cardInfo = {
“id” : “” ,
“name” : firstName ,
“contactId” : contactId ,
“source” : “Corvid” ,
“createdDate” : new Date ,
“updatedDate” : new Date ,
“phaseId” : “”
};
return workflows . createCard ( workflowId , phaseId , cardInfo , position )
. then (( cardId ) => {
console . log ( “card contact” , cardId );

  **return**  [ cardId ]; 
}) 
. **catch** (( error ) => { 
  console . error ( error ); 
  **let**  response  =  error ; 
  **return**  response ; 
}); 

}