Hi, what is the use of the return of the run function in the workflow? I saw in the twillio example

Hi, what is the use of the return of the run function in the workflow?
I saw in the twillio example that it returns a value.
https://github.com/craigsdennis/twilio-cloudflare-workflow/blob/main/src/index.ts

export class NeverGonnaWorkflow extends WorkflowEntrypoint<Env, NeverGonnaParams> {
    async run(event: WorkflowEvent<NeverGonnaParams>, step: WorkflowStep) {
        const { to, host, content } = event.payload;
        await step.sleep('wait for the right moment', '135 seconds');
        const callSid = await step.do('call person back', async () => {
            const client = new Twilio(this.env.TWILIO_ACCOUNT_SID, this.env.TWILIO_AUTH_TOKEN);
            // Say verb here does text to speech
            // Play allows you to play media.
            // The mp3 file is hosted on Cloudflare Workers using dynamic assets
            const twiml = `
            <Response>
                <Say>Hello from a Cloudflare Workflow!</Say>
                <Say>You said "${content}".</Say>
                <Say>Check out this classic:</Say>
                <Play>https://${host}/classic.mp3</Play>
            </Response>`;
            const call = await client.calls.create({
                to,
                from: this.env.TWILIO_PHONE_NUMBER,
                twiml,
            });
            return call.sid;
        });

        return { success: true, callSid };   // <------ How to use this?

    }
}
GitHub
Use Cloudflare Workers to create a scheduled durable execution with your Twilio applications - craigsdennis/twilio-cloudflare-workflow
Was this page helpful?