how can I deploy a workflow in a nextjs

how can I deploy a workflow in a nextjs or tanstack start wrangler project? where do I export the workflow class. workflows needs to be exported in a src/index.ts.
1 Reply
avenceslau
avenceslau2w ago
You have to identify your entrypoint for either nextjs or tanstack start and export the workflow there. Or you can create a worker that has just your workflow (or workflows) and on your tanstack start or nextjs app you "import" via wrangler your workflow.
// on your app assuming that your worker that contains the workflows is my-worker-with-workflows
"workflows": [
{
"name": "my-workflow",
"binding": "MY_WORKFLOW",
"class_name": "MyWorkflow",
"script_name": "my-worker-with-workflows"
},
]
// on your app assuming that your worker that contains the workflows is my-worker-with-workflows
"workflows": [
{
"name": "my-workflow",
"binding": "MY_WORKFLOW",
"class_name": "MyWorkflow",
"script_name": "my-worker-with-workflows"
},
]
@HK if you have further questions let me know

Did you find this page helpful?