Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(captain-data): add piece with actions to schedule a workflow and retrieve results #4980

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AdamSelene
Copy link
Contributor

What does this PR do?

Add new integration with Captain Data (API doc)

  • schedule a workflow
  • retrieve results
  • custom API call

Copy link

nx-cloud bot commented Jun 24, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 5a6321e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 3 targets

Sent with 💌 from NxCloud.

@AdamSelene
Copy link
Contributor Author

Logo:

03ab0ac731008522d253a02cb939c9fb7645f807cbfba4cd064866356b6e9a8e

@AdamSelene AdamSelene force-pushed the olivier-sambourg/feat-captain-data-add-piece-with-actions-to-schedule-a-workflow-and-retrieve-results branch from 34e626f to e4be463 Compare June 24, 2024 21:04
description:
'See https://docs.captaindata.co/#36e905b6-3a31-4bcd-8c6f-0eb6093b5a8a for details',
required: true,
}),
Copy link
Collaborator

@kishanprmr kishanprmr Jun 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to create separate field for each workflow step configuration instead of JSON?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory yes but it would require more work to generate the dynamic props - I'd rather do it in a second stage (particularly since I'm myself not very familiar with Captain Data)
My specific use case here is to prevent my users from using a generic HTTP pieces with unsafe API keys in headers 😬

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add this action in the second stage, as it will make it easier for the user to set up the workflow configuration from dynamic properties. What do you think?

Copy link
Contributor Author

@AdamSelene AdamSelene Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean remove the action for now and add it back in a second PR when it's more "baked"? I can do that yes!
As long as we have the custom api call users won't be blocked

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please add this action in the next PR. Let's merge it after you remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kishanprmr I've spent a few hours trying to have something nice with dynamic props, but it turns out it's not possible today - I would need to nest dynamic drop-downs and objects and arrays within an array and ActivePieces does not allow it
I ranted a bit on our shared Slack channel 😬

Bottom line: either we ship the action with a several JSON fields (inputs and steps at least), or we drop it and leave users with custom api call.
I think it's still better to have the explicit action, even if not perfect - WDYT?

{
    "job_name": "My Linkedin Company Search job ", -> ShortText, easy
    "unstructured_meta": true, -> Checkbox but effect of "true" is not documented
    "inputs": [ -> Array but why? Should be a single object :face_palm: Can't have nested object in array yet
        { 
            "linkedin_company_search_url": "https://www.linkedin.com/search/results/companies/mySearch"        
        }
    ],
    "steps": [{ -> this gets wild
        "accounts": ["40a0b02-1d2e-406e-a2b7-ad3d83948264"], // A Linkedin account UID - but there is no way to tell from the API that for this specific STEP of this specific WORKFLOW you need a LINKEDIN account and not KASPR or LUSHA or GITHUB or any of the 29 available integrations
        "parameters": {"max_results": 42}, // Can't nest an Object in an Array
        "step_uid": "f34de6f7-da13-4dc2-bfdb-27601e651be4", // By wrapping the Array within a DynamicProperties I can use a StaticDropdown here
    }],
}

@AdamSelene AdamSelene force-pushed the olivier-sambourg/feat-captain-data-add-piece-with-actions-to-schedule-a-workflow-and-retrieve-results branch from e4be463 to 04d54d2 Compare June 25, 2024 12:20
@AdamSelene AdamSelene force-pushed the olivier-sambourg/feat-captain-data-add-piece-with-actions-to-schedule-a-workflow-and-retrieve-results branch from 04d54d2 to f8b573a Compare June 28, 2024 19:45
@AdamSelene AdamSelene force-pushed the olivier-sambourg/feat-captain-data-add-piece-with-actions-to-schedule-a-workflow-and-retrieve-results branch from f8b573a to 5a6321e Compare June 28, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants