Dynamic generation of local specification definitions for composition of workflow microservices
The technology disclosed herein identifying a workflow file in a storage location associated with a trigger event responsive to detecting the trigger event, generating, using the identified workflow file, a new specification definition, storing, in a temporary service registry, the new specification definition, wherein the new specification definition is one of a plurality of temporary specification definitions in the temporary service registry, and identifying from the list of specification definitions the one or more specification definitions based on a parameter of a request responsive to receiving the request for one or more specification definitions of a list of specification definitions. The list of specification definitions including the plurality of temporary specification definitions in the temporary service registry and a plurality of predefined specification definitions in a remote service registry.
1 . A method comprising:
responsive to detecting a trigger event associated with a sub-workflow file, identifying, by a computing system comprising one or more processor devices, the sub-workflow file in a storage location associated with the trigger event, wherein the sub-workflow file is associated with a workflow microservice;
generating, using the sub-workflow file, a new specification definition that is configured to map open API definitions for the workflow microservice;
storing, in a temporary service registry local to the computing system, the new specification definition, wherein the new specification definition is one of a plurality of temporary specification definitions in the temporary service registry; and
responsive to receiving a request that requests a plurality of specification definitions of a list of specification definitions from a remote service registry, identifying, from the list of specification definitions, the plurality of specification definitions, wherein the plurality of specification definitions comprises:
one or more of the plurality of temporary specification definitions in the temporary service registry local to the computing system, the one or more of the plurality of temporary specification definitions comprising the new specification definition;
one or more of a plurality of predefined specification definitions in the remote service registry; and
building the workflow microservice using the one or more of the plurality of temporary specification definitions, the one or more of the plurality of predefined specification definitions, and the sub-workflow file.
2 . The method of claim 1 , further comprising:
providing the plurality of specification definitions to a requestor initiating the request.
3 . The method of claim 1 , wherein the request for the plurality of specification definitions indicates to include sub-workflows associated with a specification definition of the plurality of specification definitions into a main workflow file.
4 . The method of claim 1 , wherein the trigger event includes at least one of: an addition of a workflow file to the storage location or a modification of an existing workflow file in the storage location.
5 . The method of claim 1 , wherein generating, using the sub-workflow file, the new specification definition comprises populating a specification template with an identification and metadata of the sub-workflow file.
6 . The method of claim 1 , wherein storing, in the temporary service registry local to the computing system, the new specification definition comprises:
responsive to determining that a previously created instance of the specification definition exists, replacing the previously created instance of the specification definition with the new specification definition in the temporary service registry.
7 . The method of claim 1 , wherein storing, in the temporary service registry local to the computing system, the new specification definition comprises:
responsive to determining that no previously created instances of the new specification definition exist, registering the new specification definition in the temporary service registry.
8 . The method of claim 1 , wherein identifying from the list of specification definitions the plurality of specification definitions comprises:
querying the temporary service registry for the plurality of temporary specification definitions;
querying the remote service registry for the plurality of predefined specification definitions;
aggregating the plurality of temporary specification definitions and the plurality of predefined specification definitions into the list of specification definitions; and
filtering the plurality of specification definitions from the list of specification definitions.
9 . The method of claim 1 , wherein identifying, from the list of specification definitions, the plurality of specification definitions comprises:
identifying, from the list of specification definitions, the plurality of specification definitions based on a parameter of the request, wherein the parameter is one of: a partial text or a full text associated with an identification of the one or more specification definitions.
10 . A system comprising:
a memory;
a processing device operatively coupled to the memory, the processing device to:
responsive to detecting a trigger event associated with a sub-workflow file, identify the sub-workflow file in a storage location associated with the trigger event, wherein the sub-workflow file is associated with a workflow microservice;
generate, using the sub-workflow file, a new specification definition that is configured to map open API definitions for the workflow microservice;
store, in a temporary service registry local to the system, the new specification definition, wherein the new specification definition is one of a plurality of temporary specification definitions in the temporary service registry; and
responsive to receiving a request that requests a plurality of specification definitions of a list of specification definitions from a remote service registry, identify, from the list of specification definitions, the plurality of specification definitions, wherein the plurality of specification definitions comprises:
one or more of the plurality of temporary specification definitions in the temporary service registry local to the system, the one or more of the plurality of temporary specification definitions comprising the new specification definition; and
one or more of a plurality of predefined specification definitions in the remote service registry; and
build the workflow microservice using the one or more of the plurality of temporary specification definitions, the one or more of the plurality of predefined specification definitions, and the sub-workflow file.
11 . The system of claim 10 , wherein the processing device is further caused to:
provide the plurality of specification definitions to a requestor initiating the request.
12 . The system of claim 10 , wherein the request for the plurality of specification definitions indicates to include sub-workflows each associated with a specification definition of the plurality of specification definitions into a main workflow file.
13 . The system of claim 10 , wherein the trigger event includes at least one of: an addition of a workflow file to the storage location or a modification of an existing workflow file in the storage location.
14 . The system of claim 10 , wherein generating, using the sub-workflow file, the new specification definition comprises populating a specification template with an identification and metadata of the sub-workflow file.
15 . The system of claim 10 , wherein storing, in the temporary service registry local to the system, the new specification definition comprises:
responsive to determining that a previously created instance of the specification definition exists, replacing the previously created instance of the specification definition with the new specification definition in the temporary service registry.
16 . The system of claim 10 , wherein storing, in the temporary service registry local to the system, the new specification definition comprises:
responsive to determining that no previously created instances of the new specification definition exist, registering the new specification definition in the temporary service registry.
17 . The system of claim 10 , wherein identifying from the list of specification definitions the plurality of specification definitions comprises:
querying the temporary service registry for the plurality of temporary specification definitions;
querying the remote service registry for the plurality of predefined specification definitions;
aggregating the plurality of temporary specification definitions and the plurality of predefined specification definitions into the list of specification definitions; and
filtering the plurality of specification definitions from the list of specification definitions.
18 . A non-transitory computer readable storage medium including instructions that, when executed by a processing device of a computing system, cause the processing device to:
responsive to saving a sub-workflow file associated with a workflow microservice, add a new temporary specification definition based on the sub-workflow file to a plurality of temporary specification definitions in a temporary service registry local to the computing system, wherein the new temporary specification definition is configured to map open API definitions for the workflow microservice; and
responsive to a request to include a sub-workflow into a main workflow, provide a list of available specification definitions, wherein the request requests the list of available specification definitions from a remote service registry, wherein the list of specification definitions includes one or more of the plurality of temporary specification definitions from the temporary service registry local to the computing system and one or more of a plurality of predefined specification definitions from the remote service registry; and
build the workflow microservice using the one or more of the plurality of temporary specification definitions from the temporary service registry, the one or more of the plurality of predefined specification definitions from the remote service registry, and the sub-workflow file.
19 . The non-transitory computer readable storage medium of claim 18 , wherein adding the new temporary specification definition based on the sub-workflow file to the plurality of temporary specification definitions in the temporary service registry local to the computing system comprises:
populating a specification template with an identification and metadata of the sub-workflow file;
saving the populated specification template as the new temporary specification definition;
responsive to determining that a previously created instance of the new temporary specification definition exists, replacing the previously created instance of the new temporary specification definition with the new temporary specification definition in the temporary service registry; and
responsive to determining that a previously created instance of the new temporary specification definition does not exist, registering the new temporary specification definition to the temporary service registry.
20 . The non-transitory computer readable storage medium of claim 18 , wherein the list of specification definitions is filtered based on a parameter of the request.