synapse
synapse copied to clipboard
Run saved JSON specification from code
What is the question:
Please provide an example on how to read workflow specification JSON and run programmatically .
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)
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 ?
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} ?
Here is the message when trying to access document URL .
The screenshot I provided is when trying to save a workflow
Here is the message when trying to access document URL .
Indeed, the Swagger URL needs to be fixed, I wasn't sure.
The screenshot I provided is when trying to save a workflow
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
.
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
Closed as stale