How can I view when a Switch Flow was last used?
- magnussandstrom
- Advanced member
- Posts: 362
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
How can I view when a Switch Flow was last used?
Hi, as a Switch admin it sometimes good to know if a flow is still in use, especially when building special flows on request. Is there an easy way to see when a flow was last processed a job (if it's not avalible in Messages)?
Re: How can I view when a Switch Flow was last used?
You can set up an database like MySQL and send an HTPP-Request to it (over PHP) and store data that way.
You have the Switch variables [Switch.FlowName] and [Switch.Date:TimeZone="UTC"] that give you the data you need to see when it last was used.
You have the Switch variables [Switch.FlowName] and [Switch.Date:TimeZone="UTC"] that give you the data you need to see when it last was used.
Re: How can I view when a Switch Flow was last used?
Indeed, same idea.
Using apps, you can also log to csv, Google Sheets, …
Using apps, you can also log to csv, Google Sheets, …
Laurent De Wilde, Solution Architect @ Enfocus
Re: How can I view when a Switch Flow was last used?
@jan_suhr's way (or writing directly to db, too) is the best (and only) way currently to do it reliably, but if you don't have that implemented, you can try checking what the flow's the backing folders' modification dates at data root\Switch Server\backing\flow name\automanaged are – it's certainly not 100 % reliable because someone might have visited the folder manually earlier and made the date change, but if the date is old, then I think you can rely on it showing that the flow hasn't been used in a while...
However, I wonder if it would be a big thing for Enfocus to include it in the Flow details, too, I'm sure many would find it a useful out-of-the-box feature. Actually, I submitted a feature request last September (ENFFR-2560) asking them to include the modification date and user who modified it, to the Designer's Properties pane and Admin portal so this idea would be a useful addition to that Currently, there is only the Created date in the description field if it's left intact, but having a date from 2013 or 2016 isn't that useful...
However, I wonder if it would be a big thing for Enfocus to include it in the Flow details, too, I'm sure many would find it a useful out-of-the-box feature. Actually, I submitted a feature request last September (ENFFR-2560) asking them to include the modification date and user who modified it, to the Designer's Properties pane and Admin portal so this idea would be a useful addition to that Currently, there is only the Created date in the description field if it's left intact, but having a date from 2013 or 2016 isn't that useful...
Re: How can I view when a Switch Flow was last used?
Yet another method: if you have the Reporting Module then the processed jobs stay in the database for the number of days specified in the Preferences. You can use a GraphQL query to check how many jobs were processed by all flows during a certain period. Here is a query you can use in the Switch Web Services REST API:
https://www.enfocus.com/manuals/Develop ... ardGraphQL
If you see that the count on a certain flow is 0 then it means it has not been used during the period specified in the query.
This can of course also be integrated in a web page that lists the result of the query so it is a better user experience.
https://www.enfocus.com/manuals/Develop ... ardGraphQL
Code: Select all
{
getJobCountPerFlow: jobs_hist(groupBy: ["flow"],
since: "2021-01-01T00:00:00Z",
to: "2021-05-01T00:00:00Z",
period: "month" ) {
jobs {
group {
flow
}
count
}
}
}
This can of course also be integrated in a web page that lists the result of the query so it is a better user experience.
- magnussandstrom
- Advanced member
- Posts: 362
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: How can I view when a Switch Flow was last used?
I also vote for the above as a feature request. For now I will just add a connection that writes small textfiles with jobname_timestamp.txt in all my flows.patej wrote: ↑Tue Apr 13, 2021 2:31 pm I wonder if it would be a big thing for Enfocus to include it in the Flow details, too, I'm sure many would find it a useful out-of-the-box feature. Actually, I submitted a feature request last September (ENFFR-2560) asking them to include the modification date and user who modified it, to the Designer's Properties pane and Admin portal so this idea would be a useful addition to that Currently, there is only the Created date in the description field if it's left intact, but having a date from 2013 or 2016 isn't that useful...