serverlessworkflow / synapse

Serverless Workflow Management System (WFMS)
https://serverlessworkflow.io
Apache License 2.0
226 stars 35 forks source link

Run saved JSON specification from code #362

Closed rmanjusha closed 3 months ago

rmanjusha commented 6 months ago

What is the question:

Please provide an example on how to read workflow specification JSON and run programmatically .

JBBianchi commented 6 months ago

Hello,

A Swagger (OpenAPI) doc should be available under /api/doc but isn't at the moment due to a wrong configuration in the server start up.

In the meanwhile, you can inspect what the dashboard is doing using your browser's dev console.

For instance, getting the info of a workflow is done via a GET request on /api/v1/workflows/{workflow-id} and starting a workflow can be done with a POST to /api/v1/workflow-instances with:

{
  "workflowId":"{workflow-id}",
  "inputData":{},
  "autoStart":true
}

Where {workflow-id} is for instance myworkflow:1.0

Edit: Using the fully qualified URL to access the doc might work: /api/doc/index.html (default: http://localhost:42286/api/doc/index.html)

rmanjusha commented 6 months ago

The URLs isn`t working for me . I used yaml - (https://github.com/serverlessworkflow/synapse/blob/main/deployment/docker-compose/eventstore%2Bmongo.yml) for docker compose.

Browser console shows error with /api urls . Am I missing something with set up ?

image

JBBianchi commented 6 months ago

Afaik those errors just mean there is no report (and probably no workflow run) for that day.

What's the result of a GET request on http://localhost:42286/api/v1/workflows/{workflowId} ?

rmanjusha commented 6 months ago

Here is the message when trying to access document URL .

image

The screenshot I provided is when trying to save a workflow

image

JBBianchi commented 6 months ago

Here is the message when trying to access document URL .

image

Indeed, the Swagger URL needs to be fixed, I wasn't sure.

The screenshot I provided is when trying to save a workflow

image

This is not related to this issue but #361 if I'm not mistaken. I must admit I don't understand why there is an error related to api.github.com .

rmanjusha commented 6 months ago

Sorry to mix two issues , I doubted if that had a relation.

Noticed that http://localhost:42286/api/doc/index.html works if I clear cookies. But after getting save workflow error , the doc/index.html url isn`t working most times . Issue looks weird .

Tried with Chrome Version 123.0.6312.123 and incognito mode. Also with Microsoft Edge Version 123.0.2420.97 (Official build) (64-bit). All have the same behavior

cdavernas commented 3 months ago

Closed as stale