You can always fire off another Workflow, even from within a Workflow. Workflows _are_ the way to ru
You can always fire off another Workflow, even from within a Workflow. Workflows are the way to run tasks concurrently, or in parallel.



--remote, no real operations are taking place on my buckets. So calling list doesn't return anything. --remote and call my worfklow, i get a workflow.not_found. --remote because workflows are not supported in remoteWORKFLOW.get(id) will return the finished instance? Also, does .restart() work for finished workflows too?

.restart() is not implemented yet
javascript debug terminal and it works fine. For some reason it doesn't w/ workflows - all of my breakpoints are "unbound"javascript debug terminal I have to run wrangler dev and then attach vs code to the process. The same works fine w/ workflows.instance.restart, instance.terminate, etc. and it says Not implemented yet. Any tips on that?--remote)--remoteconsole.logsexport 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?
}
}--remote--remote--remote--remote--remotelistworkflow.not_foundWORKFLOW.get(id).restart().restart()javascript debug terminaljavascript debug terminalwrangler devinstance.restartinstance.terminateNot implemented yetconsole.logconst uploads = await Promise.all(
batch.map(async (image, index) => {
// Add 1 second sleep between uploads, but not before the first one
if (index > 0) {
await step.sleep(`delay-upload-${i}-${index}`, "1 second");
}
return step.do(
`process-image-${i}`,
{
retries: {
limit: 3,
delay: "5 seconds",
backoff: "exponential",
},
},
() => this.downloadAndUploadImage(image, orgId)
);
})
);